diff options
author | dc443y <dc443y@att.com> | 2022-01-21 14:43:18 -0600 |
---|---|---|
committer | dc443y <dc443y@att.com> | 2022-01-21 14:59:42 -0600 |
commit | c445d7865f1ded1c62f720abb70382b2963fff57 (patch) | |
tree | 059ff8eaa968a5e2a1c39a0a456741e6f94097ae /models-sim | |
parent | 7a718bd9b82ac16e5d49a1a2fb2256682f020656 (diff) |
Add configurable port and authentication to DMaaP simulator
Issue-ID: POLICY-3890
Signed-off-by: dc443y <dc443y@att.com>
Change-Id: Idbeb3590a767e51aa0058a7a45d56a61e81301cb
Diffstat (limited to 'models-sim')
-rw-r--r-- | models-sim/models-sim-dmaap/src/main/java/org/onap/policy/models/sim/dmaap/parameters/RestServerParameters.java | 12 |
1 files changed, 12 insertions, 0 deletions
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(), |