aboutsummaryrefslogtreecommitdiffstats
path: root/vid-ext-services-simulator/src/main/java
diff options
context:
space:
mode:
authorIttay Stern <ittay.stern@att.com>2019-08-07 18:39:22 +0300
committerIttay Stern <ittay.stern@att.com>2019-08-12 07:27:23 +0000
commitaff68cfa08f0a0e154b303bf228c929fcf5d9549 (patch)
treed922405c2f171af9a1c019e8f0cca412143ec45f /vid-ext-services-simulator/src/main/java
parentb3272c142193cd37f5dae7807e713819885d102d (diff)
Change out-of-the-box config to work on dev's environment
1) Fill-up system.properties's missing fields, and same for system_template.properties. This modifies some SO endpoints, most significantly -- mso.restapi.vnf.instance is now /serviceInstantiation/v7/serviceInstances/<service_instance_id>/vnfs instead of /serviceInstances/v6/<service_instance_id>/vnfs 2) Configure endpoint's to a local simulator's location: * ecomp_rest_url in portal.properties * mso.server.url, aai.server.url in system.properties * asdc.client.rest.host in asdc.properties 3) Added always-on getSessionSlotCheckInterval in simulator. Issue-ID: VID-564 Change-Id: Icc7bdc83ed65df3415a4b0f36f98291775909f49 Signed-off-by: Ittay Stern <ittay.stern@att.com>
Diffstat (limited to 'vid-ext-services-simulator/src/main/java')
-rw-r--r--vid-ext-services-simulator/src/main/java/org/onap/simulator/controller/SimulatorController.java75
1 files changed, 50 insertions, 25 deletions
diff --git a/vid-ext-services-simulator/src/main/java/org/onap/simulator/controller/SimulatorController.java b/vid-ext-services-simulator/src/main/java/org/onap/simulator/controller/SimulatorController.java
index 06c72cbd4..3845c7419 100644
--- a/vid-ext-services-simulator/src/main/java/org/onap/simulator/controller/SimulatorController.java
+++ b/vid-ext-services-simulator/src/main/java/org/onap/simulator/controller/SimulatorController.java
@@ -1,8 +1,41 @@
package org.onap.simulator.controller;
+import static org.mockserver.integration.ClientAndServer.startClientAndServer;
+import static org.mockserver.matchers.Times.exactly;
+import static org.mockserver.model.JsonBody.json;
+
import com.fasterxml.jackson.databind.DeserializationFeature;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
+import java.io.BufferedInputStream;
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URLEncoder;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.Map;
+import java.util.Properties;
+import java.util.Scanner;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+import javax.annotation.PostConstruct;
+import javax.annotation.PreDestroy;
+import javax.persistence.EntityManager;
+import javax.persistence.EntityManagerFactory;
+import javax.persistence.Persistence;
+import javax.persistence.TypedQuery;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
import org.mockserver.integration.ClientAndServer;
import org.mockserver.matchers.MatchType;
import org.mockserver.matchers.Times;
@@ -20,36 +53,22 @@ import org.springframework.core.io.Resource;
import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.core.io.support.PropertiesLoaderUtils;
import org.springframework.core.io.support.ResourcePatternResolver;
-import org.springframework.http.*;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.bind.annotation.ResponseStatus;
+import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpClientErrorException;
import org.springframework.web.client.RestTemplate;
import org.springframework.web.servlet.View;
-import javax.annotation.PostConstruct;
-import javax.annotation.PreDestroy;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import javax.persistence.TypedQuery;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.*;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URLEncoder;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.Paths;
-import java.util.*;
-import java.util.stream.Collectors;
-import java.util.stream.Stream;
-
-import static org.mockserver.integration.ClientAndServer.startClientAndServer;
-import static org.mockserver.matchers.Times.exactly;
-import static org.mockserver.model.JsonBody.json;
-
@RestController
@Component
public class SimulatorController {
@@ -245,8 +264,14 @@ public class SimulatorController {
return new ResponseEntity<>(jsonString, HttpStatus.OK);
}
+
//*******portal role access simulator end
+ @RequestMapping(value = {"/ecompportal_att/auxapi//{ver}/getSessionSlotCheckInterval", "/ONAPPORTAL/auxapi//{ver}/getSessionSlotCheckInterval"}, method = RequestMethod.GET)
+ @ResponseBody
+ public String getSessionSlotCheckInterval() {
+ return "300000";
+ }
@RequestMapping(value = {"/**"})
public ResponseEntity redirectToMockServer(HttpServletRequest request, HttpServletResponse response) throws IOException {