diff options
Diffstat (limited to 'main/src/main/java/org/onap/policy/pap')
5 files changed, 6 insertions, 67 deletions
diff --git a/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java b/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java index 0690fadd..ed1b4adc 100644 --- a/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java +++ b/main/src/main/java/org/onap/policy/pap/main/parameters/PapParameterGroup.java @@ -22,7 +22,8 @@ package org.onap.policy.pap.main.parameters; import lombok.Getter; - +import org.onap.policy.common.endpoints.parameters.RestServerParameters; +import org.onap.policy.common.endpoints.parameters.TopicParameterGroup; import org.onap.policy.common.parameters.ParameterGroupImpl; import org.onap.policy.common.parameters.annotations.NotBlank; import org.onap.policy.common.parameters.annotations.NotNull; @@ -40,6 +41,7 @@ public class PapParameterGroup extends ParameterGroupImpl { private RestServerParameters restServerParameters; private PdpParameters pdpParameters; private PolicyModelsProviderParameters databaseProviderParameters; + private TopicParameterGroup topicParameterGroup; /** * Create the pap parameter group. diff --git a/main/src/main/java/org/onap/policy/pap/main/parameters/RestServerParameters.java b/main/src/main/java/org/onap/policy/pap/main/parameters/RestServerParameters.java deleted file mode 100644 index 99b346e1..00000000 --- a/main/src/main/java/org/onap/policy/pap/main/parameters/RestServerParameters.java +++ /dev/null @@ -1,52 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * Copyright (C) 2019 Nordix Foundation. - * Modifications Copyright (C) 2019 AT&T Intellectual Property. - * ================================================================================ - * 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.pap.main.parameters; - -import lombok.Getter; -import org.onap.policy.common.parameters.ParameterGroupImpl; -import org.onap.policy.common.parameters.annotations.Min; -import org.onap.policy.common.parameters.annotations.NotBlank; -import org.onap.policy.common.parameters.annotations.NotNull; - -/** - * Class to hold all parameters needed for pap rest server. - * - * @author Ram Krishna Verma (ram.krishna.verma@est.tech) - */ -@NotNull -@NotBlank -@Getter -public class RestServerParameters extends ParameterGroupImpl { - private String host; - - @Min(value = 1) - private int port; - - private String userName; - private String password; - private boolean https; - private boolean aaf; - - public RestServerParameters() { - super("RestServerParameters"); - } -} diff --git a/main/src/main/java/org/onap/policy/pap/main/rest/PapRestServer.java b/main/src/main/java/org/onap/policy/pap/main/rest/PapRestServer.java index 85c6f3c6..c86cb81e 100644 --- a/main/src/main/java/org/onap/policy/pap/main/rest/PapRestServer.java +++ b/main/src/main/java/org/onap/policy/pap/main/rest/PapRestServer.java @@ -27,9 +27,9 @@ import java.util.Properties; import org.onap.policy.common.capabilities.Startable; import org.onap.policy.common.endpoints.http.server.HttpServletServer; +import org.onap.policy.common.endpoints.parameters.RestServerParameters; import org.onap.policy.common.endpoints.properties.PolicyEndPointProperties; import org.onap.policy.common.gson.GsonMessageBodyHandler; -import org.onap.policy.pap.main.parameters.RestServerParameters; import org.onap.policy.pap.main.rest.depundep.PdpGroupDeleteControllerV1; import org.onap.policy.pap.main.rest.depundep.PdpGroupDeployControllerV1; import org.slf4j.Logger; diff --git a/main/src/main/java/org/onap/policy/pap/main/startstop/Main.java b/main/src/main/java/org/onap/policy/pap/main/startstop/Main.java index 6351fa80..ba73d354 100644 --- a/main/src/main/java/org/onap/policy/pap/main/startstop/Main.java +++ b/main/src/main/java/org/onap/policy/pap/main/startstop/Main.java @@ -21,10 +21,9 @@ package org.onap.policy.pap.main.startstop; -import java.io.FileInputStream; import java.util.Arrays; import java.util.Properties; - +import org.onap.policy.common.endpoints.utils.ParameterUtils; import org.onap.policy.common.utils.services.Registry; import org.onap.policy.pap.main.PapConstants; import org.onap.policy.pap.main.PolicyPapException; @@ -81,16 +80,7 @@ public class Main { } // Read the properties - final Properties props = new Properties(); - try { - final String propFile = arguments.getFullPropertyFilePath(); - try (FileInputStream stream = new FileInputStream(propFile)) { - props.load(stream); - } - } catch (final Exception e) { - LOGGER.error(START_FAILED, e); - return; - } + Properties props = ParameterUtils.getTopicProperties(parameterGroup.getTopicParameterGroup()); // Initialize database try { diff --git a/main/src/main/java/org/onap/policy/pap/main/startstop/PapCommandLineArguments.java b/main/src/main/java/org/onap/policy/pap/main/startstop/PapCommandLineArguments.java index fd728d28..c917082e 100644 --- a/main/src/main/java/org/onap/policy/pap/main/startstop/PapCommandLineArguments.java +++ b/main/src/main/java/org/onap/policy/pap/main/startstop/PapCommandLineArguments.java @@ -163,7 +163,6 @@ public class PapCommandLineArguments { */ public void validate() throws PolicyPapException { validateReadableFile("policy pap configuration", configurationFilePath); - validateReadableFile("policy pap properties", propertyFilePath); } /** |