aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilter.java39
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java12
-rw-r--r--plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilterTest.java37
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java11
-rw-r--r--services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterAafFilter.java39
5 files changed, 9 insertions, 129 deletions
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilter.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilter.java
deleted file mode 100644
index 2c38cb489..000000000
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.plugins.event.carrier.restserver;
-
-import org.onap.policy.common.endpoints.http.server.aaf.AafGranularAuthFilter;
-
-/**
- * Class to manage aaf filters for Apex Rest Server.
- *
- * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
- */
-public class ApexRestServerAafFilter extends AafGranularAuthFilter {
-
- public static final String AAF_NODETYPE = "apex-rest-server";
- public static final String AAF_ROOT_PERMISSION = DEFAULT_NAMESPACE + "." + AAF_NODETYPE;
-
- @Override
- public String getPermissionTypeRoot() {
- return AAF_ROOT_PERMISSION;
- }
-}
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java
index fdad6621f..edefc7a38 100644
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java
+++ b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/main/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerConsumer.java
@@ -62,7 +62,7 @@ public class ApexRestServerConsumer extends ApexPluginsEventConsumer {
private HttpServletServer server;
// Holds the next identifier for event execution.
- private static AtomicLong nextExecutionID = new AtomicLong(0L);
+ private static final AtomicLong nextExecutionID = new AtomicLong(0L);
/**
* Private utility to get the next candidate value for a Execution ID. This value will always be unique in a single
@@ -84,16 +84,15 @@ public class ApexRestServerConsumer extends ApexPluginsEventConsumer {
this.name = consumerName;
// Check and get the REST Properties
- if (!(consumerParameters.getCarrierTechnologyParameters() instanceof RestServerCarrierTechnologyParameters)) {
+ // The REST parameters read from the parameter service
+ if (!(consumerParameters.getCarrierTechnologyParameters()
+ instanceof RestServerCarrierTechnologyParameters restConsumerProperties)) {
final String errorMessage =
"specified consumer properties are not applicable to REST Server consumer (" + this.name + ")";
LOGGER.warn(errorMessage);
throw new ApexEventException(errorMessage);
}
- // The REST parameters read from the parameter service
- RestServerCarrierTechnologyParameters restConsumerProperties =
- (RestServerCarrierTechnologyParameters) consumerParameters.getCarrierTechnologyParameters();
// Check if we are in synchronous mode
if (!consumerParameters.isPeeredMode(EventHandlerPeeredMode.SYNCHRONOUS)) {
@@ -140,9 +139,6 @@ public class ApexRestServerConsumer extends ApexPluginsEventConsumer {
false
);
- if (restConsumerProperties.isAaf()) {
- server.addFilterClass(null, ApexRestServerAafFilter.class.getName());
- }
server.addServletClass(null, RestServerEndpoint.class.getName());
server.addServletClass(null, AccessControlFilter.class.getName());
server.setSerializationProvider(GsonMessageBodyHandler.class.getName());
diff --git a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilterTest.java b/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilterTest.java
deleted file mode 100644
index dfa19e577..000000000
--- a/plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restserver/src/test/java/org/onap/policy/apex/plugins/event/carrier/restserver/ApexRestServerAafFilterTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.plugins.event.carrier.restserver;
-
-import static org.junit.Assert.assertEquals;
-
-import org.junit.Test;
-
-public class ApexRestServerAafFilterTest {
-
- @Test
- public void testGetPermissionTypeRoot() {
- final ApexRestServerAafFilter filter = new ApexRestServerAafFilter();
-
- final String permissionTypeRoot = filter.getPermissionTypeRoot();
-
- assertEquals("org.onap.policy.apex-rest-server", permissionTypeRoot);
- }
-} \ No newline at end of file
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
index a4cd8a004..de262856d 100644
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
+++ b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/ApexStarterActivator.java
@@ -1,6 +1,6 @@
/*-
* ============LICENSE_START=======================================================
- * Copyright (C) 2019-2021 Nordix Foundation.
+ * Copyright (C) 2019-2021, 2023 Nordix Foundation.
* Modifications Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
* Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
* ================================================================================
@@ -32,7 +32,6 @@ import org.onap.policy.apex.services.onappf.exception.ApexStarterException;
import org.onap.policy.apex.services.onappf.exception.ApexStarterRunTimeException;
import org.onap.policy.apex.services.onappf.handler.PdpMessageHandler;
import org.onap.policy.apex.services.onappf.parameters.ApexStarterParameterGroup;
-import org.onap.policy.apex.services.onappf.rest.ApexStarterAafFilter;
import org.onap.policy.apex.services.onappf.rest.HealthCheckRestControllerV1;
import org.onap.policy.common.endpoints.event.comm.TopicEndpointManager;
import org.onap.policy.common.endpoints.event.comm.TopicSink;
@@ -58,8 +57,8 @@ public class ApexStarterActivator {
private static final Logger LOGGER = LoggerFactory.getLogger(ApexStarterActivator.class);
@Getter
private final ApexStarterParameterGroup parameterGroup;
- private List<TopicSink> topicSinks; // topics to which apex-pdp sends pdp status
- private List<TopicSource> topicSources; // topics to which apex-pdp listens to for messages from pap.
+ private final List<TopicSink> topicSinks; // topics to which apex-pdp sends pdp status
+ private final List<TopicSource> topicSources; // topics to which apex-pdp listens to for messages from pap.
private static final String[] MSG_TYPE_NAMES = { "messageName" };
/**
@@ -70,7 +69,7 @@ public class ApexStarterActivator {
/**
* Used to manage the services.
*/
- private ServiceManager manager;
+ private final ServiceManager manager;
/**
* The ApexStarter REST API server.
@@ -147,7 +146,7 @@ public class ApexStarterActivator {
this::unregisterMsgDispatcher)
.addAction("Create REST server",
() -> restServer = new RestServer(apexStarterParameterGroup.getRestServerParameters(),
- ApexStarterAafFilter.class, HealthCheckRestControllerV1.class),
+ List.of(), List.of(HealthCheckRestControllerV1.class)),
() -> restServer = null)
.addAction("Rest Server",
() -> restServer.start(),
diff --git a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterAafFilter.java b/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterAafFilter.java
deleted file mode 100644
index 2745a79f9..000000000
--- a/services/services-onappf/src/main/java/org/onap/policy/apex/services/onappf/rest/ApexStarterAafFilter.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2019 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.apex.services.onappf.rest;
-
-import org.onap.policy.common.endpoints.http.server.aaf.AafGranularAuthFilter;
-
-/**
- * Class to manage aaf filters for services-onappf component.
- *
- * @author Ajith Sreekumar (ajith.sreekumar@est.tech)
- */
-public class ApexStarterAafFilter extends AafGranularAuthFilter {
-
- public static final String AAF_NODETYPE = "policy-apex-pdp";
- public static final String AAF_ROOT_PERMISSION = DEFAULT_NAMESPACE + "." + AAF_NODETYPE;
-
- @Override
- public String getPermissionTypeRoot() {
- return AAF_ROOT_PERMISSION;
- }
-}