summaryrefslogtreecommitdiffstats
path: root/vnfm-simulator/vnfm-service/src/main/java/org
diff options
context:
space:
mode:
authorMichaelMorris <michael.morris@est.tech>2019-07-18 11:42:07 +0000
committerMichaelMorris <michael.morris@est.tech>2019-07-18 11:42:07 +0000
commitd419c8d0fbfb235234c5a3f01711b1c76a9748bb (patch)
tree36ea085aac53cb5417495bed6b29cc57e70bd416 /vnfm-simulator/vnfm-service/src/main/java/org
parent785c77ae295b287678d4842269222c31b3e4c330 (diff)
Implement TLS for calls from VNFM adapter to VNFM
Issue-ID: SO-2116 Change-Id: I1e5bdfcf3164545c89fb370014d49ef3ae6a9cf1 Signed-off-by: MichaelMorris <michael.morris@est.tech>
Diffstat (limited to 'vnfm-simulator/vnfm-service/src/main/java/org')
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java10
-rw-r--r--vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java2
2 files changed, 8 insertions, 4 deletions
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
index 91b79754a5..32c05ebca8 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
+++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/config/ApplicationConfig.java
@@ -4,6 +4,7 @@ import java.net.InetAddress;
import java.util.Arrays;
import org.onap.svnfm.simulator.constants.Constant;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.cache.Cache;
@@ -19,6 +20,9 @@ public class ApplicationConfig implements ApplicationRunner {
private static final String PORT = "local.server.port";
+ @Value("${server.dns.name:so-vnfm-simulator.onap}")
+ private String serverDnsName;
+
@Autowired
private Environment environment;
@@ -26,7 +30,7 @@ public class ApplicationConfig implements ApplicationRunner {
@Override
public void run(final ApplicationArguments args) throws Exception {
- baseUrl = "http://" + InetAddress.getLocalHost().getHostAddress() + ":" + environment.getProperty(PORT);
+ baseUrl = "https://" + serverDnsName + ":" + environment.getProperty(PORT);
}
public String getBaseUrl() {
@@ -35,8 +39,8 @@ public class ApplicationConfig implements ApplicationRunner {
@Bean
public CacheManager cacheManager() {
- Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE);
- SimpleCacheManager manager = new SimpleCacheManager();
+ final Cache inlineResponse201 = new ConcurrentMapCache(Constant.IN_LINE_RESPONSE_201_CACHE);
+ final SimpleCacheManager manager = new SimpleCacheManager();
manager.setCaches(Arrays.asList(inlineResponse201));
return manager;
}
diff --git a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
index 9c3a02d4e6..d3ff66aed0 100644
--- a/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
+++ b/vnfm-simulator/vnfm-service/src/main/java/org/onap/svnfm/simulator/controller/SvnfmController.java
@@ -168,6 +168,6 @@ public class SvnfmController {
final HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
- return new ResponseEntity<>(response, headers, HttpStatus.OK);
+ return new ResponseEntity<>(response, headers, HttpStatus.CREATED);
}
}