From c445d7865f1ded1c62f720abb70382b2963fff57 Mon Sep 17 00:00:00 2001 From: dc443y Date: Fri, 21 Jan 2022 14:43:18 -0600 Subject: Add configurable port and authentication to DMaaP simulator Issue-ID: POLICY-3890 Signed-off-by: dc443y Change-Id: Idbeb3590a767e51aa0058a7a45d56a61e81301cb --- .../models/sim/dmaap/parameters/RestServerParameters.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'models-sim/models-sim-dmaap/src/main') diff --git a/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/parameters/RestServerParameters.java b/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/parameters/RestServerParameters.java index 8414d0718..04d914c1a 100644 --- a/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/parameters/RestServerParameters.java +++ b/models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/parameters/RestServerParameters.java @@ -45,6 +45,12 @@ public class RestServerParameters extends ParameterGroupImpl { @Min(value = 1) private int port; + private String userName; + + private String password; + + private boolean useHttps; + public RestServerParameters() { super(RestServerParameters.class.getSimpleName()); } @@ -69,6 +75,12 @@ public class RestServerParameters extends ParameterGroupImpl { DmaapSimRestControllerV1.class.getName()); props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_MANAGED_SUFFIX, "false"); props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SWAGGER_SUFFIX, "false"); + props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_HTTPS_SUFFIX, Boolean.toString(isUseHttps())); + + if (getUserName() != null && getPassword() != null) { + props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_USERNAME_SUFFIX, getUserName()); + props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_AUTH_PASSWORD_SUFFIX, getPassword()); + } props.setProperty(svcpfx + PolicyEndPointProperties.PROPERTY_HTTP_SERIALIZATION_PROVIDER, String.join(",", CambriaMessageBodyHandler.class.getName(), -- cgit 1.2.3-korg