diff options
author | PatrikBuhr <patrik.buhr@est.tech> | 2023-04-04 10:06:22 +0200 |
---|---|---|
committer | PatrikBuhr <patrik.buhr@est.tech> | 2023-04-04 10:34:47 +0200 |
commit | 44499d09ab2842ecad245ac73de523790a5d64eb (patch) | |
tree | 99c7e7e7518a080e12baa0e7cb09c80af6c54cad /a1-policy-management/src | |
parent | 5e7e5f2c0cdd4e5554f4d8629403b7c554b3a0aa (diff) |
Regenerated documentation, code formatting
Updated the spoless maven plugin version and re-run the code formatting.
Re-generate the API documentation.
No changes.
Issue-ID: CCSDK-3883
Signed-off-by: PatrikBuhr <patrik.buhr@est.tech>
Change-Id: I95e88ebbd144b37bc1f7ca3b722bfc748e5ae801
Diffstat (limited to 'a1-policy-management/src')
18 files changed, 86 insertions, 28 deletions
diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientFactory.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientFactory.java index 54dfab88..5f573140 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientFactory.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/A1ClientFactory.java @@ -31,6 +31,7 @@ import org.onap.ccsdk.oran.a1policymanagementservice.exceptions.ServiceException import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import reactor.core.publisher.Mono; /** diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java index 04367e0e..ab2958c6 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/WebClientConfig.java @@ -23,6 +23,7 @@ package org.onap.ccsdk.oran.a1policymanagementservice.configuration; import lombok.Builder; import lombok.Getter; import lombok.ToString; + import reactor.netty.transport.ProxyProvider; @Builder diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java index f3f57067..e79a8217 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ErrorResponse.java @@ -36,6 +36,7 @@ import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatusCode; import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; + import reactor.core.publisher.Mono; public class ErrorResponse { diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyAuthorizationRequest.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyAuthorizationRequest.java new file mode 100644 index 00000000..63a53109 --- /dev/null +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyAuthorizationRequest.java @@ -0,0 +1,47 @@ +/*- + * ========================LICENSE_START================================= + * ONAP : ccsdk oran + * ====================================================================== + * Copyright (C) 2022 Nordix Foundation. All rights reserved. + * ====================================================================== + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================LICENSE_END=================================== + */ + +package org.onap.ccsdk.oran.a1policymanagementservice.controllers.v2; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.gson.annotations.SerializedName; + +import io.swagger.v3.oas.annotations.media.Schema; + +import lombok.Builder; +import lombok.Getter; + + +@Schema(name = "policy_authorization", description = "Authorization request for A1 policy requests") +@Builder +public class PolicyAuthorizationRequest { + + @Schema(name = "acces_type", description = "Access type") + public enum AccessType { + READ, WRITE, DELETE + } + + @Schema(name = "access_type", description = "Access type", required = true) + @JsonProperty(value = "access_type", required = true) + @SerializedName("access_type") + @Getter + private String accessType; + +} diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java index 500ddd2a..395daa30 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyController.java @@ -68,6 +68,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.reactive.function.client.WebClientException; import org.springframework.web.reactive.function.client.WebClientResponseException; + import reactor.core.publisher.Mono; @RestController("PolicyControllerV2") diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java index f7bc22ca..537f98c2 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/PolicyInfo.java @@ -53,7 +53,8 @@ public class PolicyInfo { + " This can be used to group the policies (it is possible to get all policies associated to a service)." + " Note that the service does not need to be registered."; - @Schema(name = "service_id", description = SERVICE_ID_DESCRIPTION, requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "") + @Schema(name = "service_id", description = SERVICE_ID_DESCRIPTION, requiredMode = RequiredMode.NOT_REQUIRED, + defaultValue = "") @JsonProperty(value = "service_id", required = false) @SerializedName("service_id") public String serviceId = ""; @@ -65,8 +66,8 @@ public class PolicyInfo { @SerializedName("transient") public boolean isTransient = false; - @Schema(name = "status_notification_uri", description = "Callback URI for policy status updates", requiredMode = RequiredMode.NOT_REQUIRED, - defaultValue = "") + @Schema(name = "status_notification_uri", description = "Callback URI for policy status updates", + requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "") @JsonProperty(value = "status_notification_uri", required = false) @SerializedName("status_notification_uri") public String statusNotificationUri = ""; diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RicInfo.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RicInfo.java index d6069aa2..81fc56cb 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RicInfo.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/RicInfo.java @@ -35,12 +35,13 @@ public class RicInfo { UNAVAILABLE, AVAILABLE, SYNCHRONIZING, CONSISTENCY_CHECK } - private static final String STATE_DESCRIPTION = """ - State for the Near-RT RIC, values: - UNAVAILABLE: The Near-RT RIC is not available, information may be inconsistent - AVAILABLE: The normal state. Policies can be configured. - SYNCHRONIZING: The Policy Management Service is synchronizing the view of the Near-RT RIC. Policies cannot be configured. - CONSISTENCY_CHECK: A consistency check between the Policy Management Service and the Near-RT RIC. Policies cannot be configured."""; + private static final String STATE_DESCRIPTION = + """ + State for the Near-RT RIC, values: + UNAVAILABLE: The Near-RT RIC is not available, information may be inconsistent + AVAILABLE: The normal state. Policies can be configured. + SYNCHRONIZING: The Policy Management Service is synchronizing the view of the Near-RT RIC. Policies cannot be configured. + CONSISTENCY_CHECK: A consistency check between the Policy Management Service and the Near-RT RIC. Policies cannot be configured."""; @Schema(description = "identity of the Near-RT RIC") @SerializedName("ric_id") diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceRegistrationInfo.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceRegistrationInfo.java index 16494076..1bbac871 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceRegistrationInfo.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/ServiceRegistrationInfo.java @@ -44,7 +44,8 @@ public class ServiceRegistrationInfo { @JsonProperty("keep_alive_interval_seconds") public long keepAliveIntervalSeconds = 0; - @Schema(description = "callback for notifying of Near-RT RIC state changes", requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "") + @Schema(description = "callback for notifying of Near-RT RIC state changes", + requiredMode = RequiredMode.NOT_REQUIRED, defaultValue = "") @SerializedName("callback_url") @JsonProperty("callback_url") public String callbackUrl = ""; diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/StatusController.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/StatusController.java index 28d434b7..64d587d9 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/StatusController.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/controllers/v2/StatusController.java @@ -32,6 +32,7 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; + import reactor.core.publisher.Mono; @RestController("StatusControllerV2") diff --git a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/datastore/S3ObjectStore.java b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/datastore/S3ObjectStore.java index 5b81f756..1c67ff7d 100644 --- a/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/datastore/S3ObjectStore.java +++ b/a1-policy-management/src/main/java/org/onap/ccsdk/oran/a1policymanagementservice/datastore/S3ObjectStore.java @@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; + import software.amazon.awssdk.auth.credentials.AwsBasicCredentials; import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider; import software.amazon.awssdk.core.BytesWrapper; diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java index cada8bc5..d33fbd65 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/aspect/LogAspectTest.java @@ -27,9 +27,6 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.read.ListAppender; - import org.aspectj.lang.ProceedingJoinPoint; import org.aspectj.lang.reflect.MethodSignature; import org.junit.jupiter.api.DisplayName; @@ -39,6 +36,9 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.onap.ccsdk.oran.a1policymanagementservice.utils.LoggingUtils; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; + @ExtendWith(MockitoExtension.class) class LogAspectTest { @Mock diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java index 12ac46de..ac9d1fba 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/clients/AsyncRestClientTest.java @@ -25,9 +25,6 @@ import io.netty.util.internal.logging.JdkLoggerFactory; import java.io.IOException; -import okhttp3.mockwebserver.MockResponse; -import okhttp3.mockwebserver.MockWebServer; - import org.junit.jupiter.api.AfterAll; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.DisplayName; @@ -40,6 +37,9 @@ import reactor.core.publisher.Mono; import reactor.test.StepVerifier; import reactor.util.Loggers; +import okhttp3.mockwebserver.MockResponse; +import okhttp3.mockwebserver.MockWebServer; + class AsyncRestClientTest { private static final String BASE_URL = "BaseUrl"; private static final String REQUEST_URL = "/test"; diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFileTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFileTest.java index b79a4ca8..befbc583 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFileTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/configuration/ConfigurationFileTest.java @@ -25,10 +25,6 @@ import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.when; -import ch.qos.logback.classic.Level; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.read.ListAppender; - import com.google.gson.JsonObject; import com.google.gson.JsonParser; @@ -45,6 +41,10 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.onap.ccsdk.oran.a1policymanagementservice.utils.LoggingUtils; +import ch.qos.logback.classic.Level; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; + @ExtendWith(MockitoExtension.class) class ConfigurationFileTest { @Mock diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java index bfdb58ca..3b1ee8f7 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RefreshConfigTaskTest.java @@ -60,6 +60,7 @@ import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Rics; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Services; + import reactor.test.StepVerifier; @ExtendWith(MockitoExtension.class) @@ -113,9 +114,7 @@ class RefreshConfigTaskTest { verify(refreshTaskUnderTest.rics, times(2)).put(any(Ric.class)); java.util.Collection<RicConfig> ricConfigs = appConfig.getRicConfigs(); - assertThat(ricConfigs) - .isNotNull() - .hasSize(2); + assertThat(ricConfigs).isNotNull().hasSize(2); } @Test diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java index 77464300..c83bb858 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/RicSupervisionTest.java @@ -56,6 +56,7 @@ import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric.RicState; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Rics; + import reactor.core.publisher.Mono; @ExtendWith(MockitoExtension.class) diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java index e8f28195..29f6affd 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/tasks/ServiceSupervisionTest.java @@ -29,9 +29,6 @@ import static org.mockito.Mockito.verifyNoInteractions; import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; -import ch.qos.logback.classic.spi.ILoggingEvent; -import ch.qos.logback.core.read.ListAppender; - import java.time.Duration; import java.time.Instant; @@ -52,8 +49,12 @@ import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Service; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Services; import org.onap.ccsdk.oran.a1policymanagementservice.utils.LoggingUtils; + import reactor.core.publisher.Mono; +import ch.qos.logback.classic.spi.ILoggingEvent; +import ch.qos.logback.core.read.ListAppender; + @ExtendWith(MockitoExtension.class) class ServiceSupervisionTest { diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/LoggingUtils.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/LoggingUtils.java index 2f7d7a65..be5d47f7 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/LoggingUtils.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/LoggingUtils.java @@ -20,13 +20,13 @@ package org.onap.ccsdk.oran.a1policymanagementservice.utils; +import org.slf4j.LoggerFactory; + import ch.qos.logback.classic.Level; import ch.qos.logback.classic.Logger; import ch.qos.logback.classic.spi.ILoggingEvent; import ch.qos.logback.core.read.ListAppender; -import org.slf4j.LoggerFactory; - public class LoggingUtils { /** diff --git a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java index 22f534cf..be7dfcb3 100644 --- a/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java +++ b/a1-policy-management/src/test/java/org/onap/ccsdk/oran/a1policymanagementservice/utils/MockA1ClientFactory.java @@ -35,6 +35,7 @@ import org.onap.ccsdk.oran.a1policymanagementservice.repository.PolicyTypes; import org.onap.ccsdk.oran.a1policymanagementservice.repository.Ric; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import reactor.core.publisher.Mono; public class MockA1ClientFactory extends A1ClientFactory { |