summary |
shortlog |
log |
commit | commitdiff |
review |
tree
raw |
patch |
inline | side by side (from parent 1:
6b1a357)
Change-Id: Ifaaa03b0fda05004d27c3045f5c523282dcba238
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
24 files changed:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
- <!-- <version>${spring-web-version}</version> -->
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
- <!-- spring sets the <version>5.4.2</version> -->
<scope>test</scope>
</dependency>
</dependencies>
<scope>test</scope>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <!-- version>2.5</version> -->
<configuration>
<archive>
<manifest>
<configuration>
<archive>
<manifest>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
- <!-- <version>${spring-web-version}</version> -->
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
- <!-- spring sets the <version>5.4.2</version> -->
<scope>test</scope>
</dependency>
</dependencies>
<scope>test</scope>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <!-- version>2.5</version> -->
<configuration>
<archive>
<manifest>
<configuration>
<archive>
<manifest>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
- <!-- <version>${spring-web-version}</version> -->
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
- <!-- spring sets the <version>5.4.2</version> -->
<scope>test</scope>
</dependency>
</dependencies>
<scope>test</scope>
</dependency>
</dependencies>
* Split URL properties into prefix/suffix parts
* Add jacoco plugin to back-end for code coverage
* Compile with Java version 11, run with image openjdk:11
* Split URL properties into prefix/suffix parts
* Add jacoco plugin to back-end for code coverage
* Compile with Java version 11, run with image openjdk:11
+* Clean code of issues reported by Sonar
Version 1.0.5, 5 July 2019
--------------------------
Version 1.0.5, 5 July 2019
--------------------------
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
- <!-- <version>${spring-web-version}</version> -->
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<!-- JSON processing: jackson -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.jaxrs</groupId>
<artifactId>jackson-jaxrs-json-provider</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
- <!-- <version>${jackson-version}</version> -->
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<!-- test dependencies -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
- <!-- spring sets the <version>5.4.2</version> -->
<scope>test</scope>
</dependency>
</dependencies>
<scope>test</scope>
</dependency>
</dependencies>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
- <!-- Spring sets the <version>2.5</version> -->
<configuration>
<archive>
<manifest>
<configuration>
<archive>
<manifest>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
- <!-- spring-boot sets the <version>3.1.0</version> -->
<executions>
<execution>
<id>copy-resources</id>
<executions>
<execution>
<id>copy-resources</id>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
- <!-- spring sets the <version>2.8</version> -->
<configuration>
<skip>true</skip>
</configuration>
<configuration>
<skip>true</skip>
</configuration>
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
import org.springframework.context.annotation.ComponentScan;
@SpringBootApplication
-// Limit the annotation scan to the dashboard classes;
-// exclude the generated client classes!
+// Using this package limits the annotation scan to the dashboard classes.
+// Do not want Spring to find the autowired annotations in the generated
+// classes.
@ComponentScan("org.oransc.ric.portal.dashboard")
public class DashboardApplication {
@ComponentScan("org.oransc.ric.portal.dashboard")
public class DashboardApplication {
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
-import java.net.URI;
-import java.net.URISyntaxException;
import org.oransc.ric.a1med.client.api.A1MediatorApi;
import org.oransc.ric.a1med.client.invoker.ApiClient;
import org.oransc.ric.a1med.client.api.A1MediatorApi;
import org.oransc.ric.a1med.client.invoker.ApiClient;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.DefaultUriBuilderFactory;
/**
* Creates an A1 mediator client as a bean to be managed by the Spring
/**
* Creates an A1 mediator client as a bean to be managed by the Spring
@Autowired
public A1MediatorConfiguration(@Value("${a1med.url.prefix}") final String urlPrefix, //
@Autowired
public A1MediatorConfiguration(@Value("${a1med.url.prefix}") final String urlPrefix, //
- @Value("${a1med.url.suffix}") final String urlSuffix) throws URISyntaxException {
+ @Value("${a1med.url.suffix}") final String urlSuffix) {
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
- URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
- a1medUrl = uri.toString();
+ a1medUrl = new DefaultUriBuilderFactory(urlPrefix.trim()).builder().path(urlSuffix.trim()).build().normalize()
+ .toString();
logger.info("Configuring A1 Mediator at URL {}", a1medUrl);
}
logger.info("Configuring A1 Mediator at URL {}", a1medUrl);
}
ApiClient apiClient = apiClient();
A1MediatorApi mockApi = mock(A1MediatorApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
ApiClient apiClient = apiClient();
A1MediatorApi mockApi = mock(A1MediatorApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).a1ControllerGetHandler(any(String.class));
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).a1ControllerPutHandler(any(String.class), any(Object.class));
-
+ doAnswer(i -> null).when(mockApi).a1ControllerGetHandler(any(String.class));
+ doAnswer(i -> null).when(mockApi).a1ControllerPutHandler(any(String.class), any(Object.class));
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
-import java.net.URI;
-import java.net.URISyntaxException;
import org.oransc.ric.anrxapp.client.api.HealthApi;
import org.oransc.ric.anrxapp.client.api.NcrtApi;
import org.oransc.ric.anrxapp.client.api.HealthApi;
import org.oransc.ric.anrxapp.client.api.NcrtApi;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.DefaultUriBuilderFactory;
/**
* Creates instances of the ANR xApp client APIs.
/**
* Creates instances of the ANR xApp client APIs.
@Autowired
public AnrXappConfiguration(@Value("${anrxapp.url.prefix}") final String urlPrefix,
@Autowired
public AnrXappConfiguration(@Value("${anrxapp.url.prefix}") final String urlPrefix,
- @Value("${anrxapp.url.suffix}") final String urlSuffix) throws URISyntaxException {
+ @Value("${anrxapp.url.suffix}") final String urlSuffix) {
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
- URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
- anrXappUrl = uri.toString();
+ anrXappUrl = new DefaultUriBuilderFactory(urlPrefix.trim()).builder().path(urlSuffix.trim()).build().normalize()
+ .toString();
logger.info("Configuring ANR client at URL {}", anrXappUrl);
}
logger.info("Configuring ANR client at URL {}", anrXappUrl);
}
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
- private final NeighborCellRelationTable ncrt, ncrtNodeB1, ncrtNodeB2, ncrtNodeB3;
+ // Sonar wants separate declarations
+ private final NeighborCellRelationTable ncrt;
+ private final NeighborCellRelationTable ncrtNodeB1;
+ private final NeighborCellRelationTable ncrtNodeB2;
+ private final NeighborCellRelationTable ncrtNodeB3;
+
private final GgNodeBTable gNodebTable;
private static final String GNODEB1 = "001EF5:0045FE50";
private final GgNodeBTable gNodebTable;
private static final String GNODEB1 = "001EF5:0045FE50";
ApiClient apiClient = apiClient();
HealthApi mockApi = mock(HealthApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
ApiClient apiClient = apiClient();
HealthApi mockApi = mock(HealthApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
- doAnswer(i -> {
- return null;
- }).when(mockApi).getHealthAlive();
- doAnswer(i -> {
- return null;
- }).when(mockApi).getHealthReady();
+ doAnswer(i -> null).when(mockApi).getHealthAlive();
+ doAnswer(i -> null).when(mockApi).getHealthReady();
when(mockApi.getNcrt(eq(GNODEB1), any(String.class), any(String.class))).thenReturn(ncrtNodeB1);
when(mockApi.getNcrt(eq(GNODEB2), any(String.class), any(String.class))).thenReturn(ncrtNodeB2);
when(mockApi.getNcrt(eq(GNODEB3), any(String.class), any(String.class))).thenReturn(ncrtNodeB3);
when(mockApi.getNcrt(eq(GNODEB1), any(String.class), any(String.class))).thenReturn(ncrtNodeB1);
when(mockApi.getNcrt(eq(GNODEB2), any(String.class), any(String.class))).thenReturn(ncrtNodeB2);
when(mockApi.getNcrt(eq(GNODEB3), any(String.class), any(String.class))).thenReturn(ncrtNodeB3);
- doAnswer(i -> {
- return null;
- }).when(mockApi).deleteNcrt(any(String.class), any(String.class));
- doAnswer(i -> {
- return null;
- }).when(mockApi).modifyNcrt(any(String.class), any(String.class), any(NeighborCellRelationMod.class));
+ doAnswer(i -> null).when(mockApi).deleteNcrt(any(String.class), any(String.class));
+ doAnswer(i -> null).when(mockApi).modifyNcrt(any(String.class), any(String.class),
+ any(NeighborCellRelationMod.class));
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
-import java.net.URI;
-import java.net.URISyntaxException;
import org.oransc.ric.plt.appmgr.client.api.HealthApi;
import org.oransc.ric.plt.appmgr.client.api.XappApi;
import org.oransc.ric.plt.appmgr.client.api.HealthApi;
import org.oransc.ric.plt.appmgr.client.api.XappApi;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.DefaultUriBuilderFactory;
/**
* Creates an xApp manager client as a bean to be managed by the Spring
/**
* Creates an xApp manager client as a bean to be managed by the Spring
@Autowired
public AppManagerConfiguration(@Value("${appmgr.url.prefix}") final String urlPrefix,
@Autowired
public AppManagerConfiguration(@Value("${appmgr.url.prefix}") final String urlPrefix,
- @Value("${appmgr.url.suffix}") final String urlSuffix) throws URISyntaxException {
+ @Value("${appmgr.url.suffix}") final String urlSuffix) {
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
- URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
- xappMgrUrl = uri.toString();
+ xappMgrUrl = new DefaultUriBuilderFactory(urlPrefix.trim()).builder().path(urlSuffix.trim()).build().normalize()
+ .toString();
logger.info("Configuring App Manager at URL {}", xappMgrUrl);
}
logger.info("Configuring App Manager at URL {}", xappMgrUrl);
}
allXappConfigs.add(config);
availXapps.add(n);
Xapp xapp = new Xapp().name(n).version("version").status(StatusEnum.UNKNOWN);
allXappConfigs.add(config);
availXapps.add(n);
Xapp xapp = new Xapp().name(n).version("version").status(StatusEnum.UNKNOWN);
- xapp.addInstancesItem(new XappInstance().name("abcd-1234").ip("1.2.3.4").port(200)
+ xapp.addInstancesItem(new XappInstance().name("abcd-1234").ip("127.0.0.1").port(200)
.status(XappInstance.StatusEnum.RUNNING));
deployedXapps.add(xapp);
}
.status(XappInstance.StatusEnum.RUNNING));
deployedXapps.add(xapp);
}
when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
HealthApi mockApi = mock(HealthApi.class);
when(mockApi.getApiClient()).thenReturn(mockClient);
when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
HealthApi mockApi = mock(HealthApi.class);
when(mockApi.getApiClient()).thenReturn(mockClient);
- doAnswer(i -> {
- return null;
- }).when(mockApi).getHealthAlive();
- doAnswer(i -> {
- return null;
- }).when(mockApi).getHealthReady();
+ doAnswer(i -> null).when(mockApi).getHealthAlive();
+ doAnswer(i -> null).when(mockApi).getHealthReady();
public XappApi xappMgrXappApi() {
ApiClient mockClient = mock(ApiClient.class);
when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
public XappApi xappMgrXappApi() {
ApiClient mockClient = mock(ApiClient.class);
when(mockClient.getStatusCode()).thenReturn(HttpStatus.OK);
XappApi mockApi = mock(XappApi.class);
when(mockApi.getApiClient()).thenReturn(mockClient);
XappApi mockApi = mock(XappApi.class);
when(mockApi.getApiClient()).thenReturn(mockClient);
when(mockApi.getAllXappConfig()).thenReturn(allXappConfigs);
when(mockApi.getAllXappConfig()).thenReturn(allXappConfigs);
when(mockApi.createXappConfig(any(XAppConfig.class))).thenReturn(allXappConfigs.get(0));
when(mockApi.createXappConfig(any(XAppConfig.class))).thenReturn(allXappConfigs.get(0));
when(mockApi.modifyXappConfig(any(XAppConfig.class))).thenReturn(allXappConfigs.get(0));
when(mockApi.modifyXappConfig(any(XAppConfig.class))).thenReturn(allXappConfigs.get(0));
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).deleteXappConfig(any(ConfigMetadata.class));
-
+ doAnswer(i -> null).when(mockApi).deleteXappConfig(any(ConfigMetadata.class));
when(mockApi.deployXapp(any(XAppInfo.class))).thenReturn(deployedXapps.get(0));
when(mockApi.deployXapp(any(XAppInfo.class))).thenReturn(deployedXapps.get(0));
when(mockApi.listAllXapps()).thenReturn(availXapps);
when(mockApi.listAllXapps()).thenReturn(availXapps);
when(mockApi.getAllXapps()).thenReturn(deployedXapps);
when(mockApi.getAllXapps()).thenReturn(deployedXapps);
when(mockApi.getXappByName(any(String.class))).thenReturn(deployedXapps.get(0));
when(mockApi.getXappByName(any(String.class))).thenReturn(deployedXapps.get(0));
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).undeployXapp(any(String.class));
-
+ doAnswer(i -> null).when(mockApi).undeployXapp(any(String.class));
SubscriptionResponse subRes = new SubscriptionResponse().eventType(SubscriptionResponse.EventTypeEnum.ALL)
.id("subid").version(1);
when(mockApi.addSubscription(any(SubscriptionRequest.class))).thenReturn(subRes);
SubscriptionResponse subRes = new SubscriptionResponse().eventType(SubscriptionResponse.EventTypeEnum.ALL)
.id("subid").version(1);
when(mockApi.addSubscription(any(SubscriptionRequest.class))).thenReturn(subRes);
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).deleteSubscription(any(String.class));
-
+ doAnswer(i -> null).when(mockApi).deleteSubscription(any(String.class));
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
package org.oransc.ric.portal.dashboard.config;
import java.lang.invoke.MethodHandles;
import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
import org.oransc.ric.e2mgr.client.api.NodebApi;
import org.oransc.ric.e2mgr.client.api.HealthCheckApi;
import org.oransc.ric.e2mgr.client.api.NodebApi;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;
import org.springframework.web.client.RestTemplate;
+import org.springframework.web.util.DefaultUriBuilderFactory;
/**
* Creates an E2 manager client as a bean to be managed by the Spring container.
/**
* Creates an E2 manager client as a bean to be managed by the Spring container.
@Autowired
public E2ManagerConfiguration(@Value("${e2mgr.url.prefix}") final String urlPrefix,
@Autowired
public E2ManagerConfiguration(@Value("${e2mgr.url.prefix}") final String urlPrefix,
- @Value("${e2mgr.url.suffix}") final String urlSuffix) throws Exception {
+ @Value("${e2mgr.url.suffix}") final String urlSuffix) {
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
logger.debug("ctor prefix '{}' suffix '{}'", urlPrefix, urlSuffix);
- URI uri = new URI(urlPrefix.trim() + "/" + urlSuffix.trim()).normalize();
- e2mgrUrl = uri.toString();
+ e2mgrUrl = new DefaultUriBuilderFactory(urlPrefix.trim()).builder().path(urlSuffix.trim()).build().normalize()
+ .toString();
logger.info("Configuring E2 Manager at URL {}", e2mgrUrl);
}
logger.info("Configuring E2 Manager at URL {}", e2mgrUrl);
}
nodebIdList = new ArrayList<>();
nodebIdList.add(nbid);
nodebResponse = new GetNodebResponse().connectionStatus("mockConnectionStatus").failureType("mockFailureType")
nodebIdList = new ArrayList<>();
nodebIdList.add(nbid);
nodebResponse = new GetNodebResponse().connectionStatus("mockConnectionStatus").failureType("mockFailureType")
- .ip("1.2.3.4").nodeType("mockNodeType").port(123).ranName("mockRanName");
+ .ip("127.0.0.1").nodeType("mockNodeType").port(123).ranName("mockRanName");
}
private ApiClient apiClient() {
}
private ApiClient apiClient() {
ApiClient apiClient = apiClient();
HealthCheckApi mockApi = mock(HealthCheckApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
ApiClient apiClient = apiClient();
HealthCheckApi mockApi = mock(HealthCheckApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).healthGet();
-
+ doAnswer(i -> null).when(mockApi).healthGet();
ApiClient apiClient = apiClient();
NodebApi mockApi = mock(NodebApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
ApiClient apiClient = apiClient();
NodebApi mockApi = mock(NodebApi.class);
when(mockApi.getApiClient()).thenReturn(apiClient);
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).nodebDelete();
-
- doAnswer(i -> {
- return nodebResponse;
- }).when(mockApi).getNb(any(String.class));
-
- doAnswer(i -> {
- return nodebIdList;
- }).when(mockApi).getNodebIdList();
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).endcSetup(any(SetupRequest.class));
-
- doAnswer(i -> {
- return null;
- }).when(mockApi).x2Setup(any(SetupRequest.class));
-
+ doAnswer(i -> null).when(mockApi).nodebDelete();
+ doAnswer(i -> nodebResponse).when(mockApi).getNb(any(String.class));
+ doAnswer(i -> nodebIdList).when(mockApi).getNodebIdList();
+ doAnswer(i -> null).when(mockApi).endcSetup(any(SetupRequest.class));
+ doAnswer(i -> null).when(mockApi).x2Setup(any(SetupRequest.class));
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.RestController;
import com.fasterxml.jackson.databind.JsonNode;
import org.springframework.web.bind.annotation.RestController;
import com.fasterxml.jackson.databind.JsonNode;
}
@ApiOperation(value = "Gets the A1 client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
}
@ApiOperation(value = "Gets the A1 client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
- @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+ @GetMapping(VERSION_METHOD)
public SuccessTransport getA1MediatorClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(A1MediatorApi.class));
}
public SuccessTransport getA1MediatorClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(A1MediatorApi.class));
}
* GET policy is not supported at present by A1 Mediator! Always returns 501.
*/
@ApiOperation(value = "Gets the admission control policy for AC xApp via the A1 Mediator")
* GET policy is not supported at present by A1 Mediator! Always returns 501.
*/
@ApiOperation(value = "Gets the admission control policy for AC xApp via the A1 Mediator")
- @RequestMapping(value = ADMCTRL_METHOD, method = RequestMethod.GET)
+ @GetMapping(ADMCTRL_METHOD)
public Object getAdmissionControlPolicy(HttpServletResponse response) {
logger.debug("getAdmissionControlPolicy");
response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
public Object getAdmissionControlPolicy(HttpServletResponse response) {
logger.debug("getAdmissionControlPolicy");
response.setStatus(HttpServletResponse.SC_NOT_IMPLEMENTED);
* fields are defined in the ACAdmissionIntervalControl Typescript interface.
*/
@ApiOperation(value = "Sets the admission control policy for AC xApp via the A1 Mediator")
* fields are defined in the ACAdmissionIntervalControl Typescript interface.
*/
@ApiOperation(value = "Sets the admission control policy for AC xApp via the A1 Mediator")
- @RequestMapping(value = ADMCTRL_METHOD, method = RequestMethod.PUT)
+ @PutMapping(ADMCTRL_METHOD)
public void setAdmissionControlPolicy(@ApiParam(value = "Admission control policy") @RequestBody JsonNode acPolicy, //
HttpServletResponse response) {
logger.debug("setAdmissionControlPolicy {}", acPolicy);
public void setAdmissionControlPolicy(@ApiParam(value = "Admission control policy") @RequestBody JsonNode acPolicy, //
HttpServletResponse response) {
logger.debug("setAdmissionControlPolicy {}", acPolicy);
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
}
@ApiOperation(value = "Gets the Dashboard MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
}
@ApiOperation(value = "Gets the Dashboard MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
- @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+ @GetMapping(VERSION_METHOD)
public SuccessTransport getVersion() {
logger.debug("getVersion");
return new SuccessTransport(200,
public SuccessTransport getVersion() {
logger.debug("getVersion");
return new SuccessTransport(200,
}
@ApiOperation(value = "Checks the health of the application.", response = SuccessTransport.class)
}
@ApiOperation(value = "Checks the health of the application.", response = SuccessTransport.class)
- @RequestMapping(value = HEALTH_METHOD, method = RequestMethod.GET)
+ @GetMapping(HEALTH_METHOD)
public SuccessTransport getHealth() {
logger.debug("getHealth");
return new SuccessTransport(200, "Dashboard is healthy!");
}
@ApiOperation(value = "Gets the list of application users.", response = DashboardUser.class, responseContainer = "List")
public SuccessTransport getHealth() {
logger.debug("getHealth");
return new SuccessTransport(200, "Dashboard is healthy!");
}
@ApiOperation(value = "Gets the list of application users.", response = DashboardUser.class, responseContainer = "List")
- @RequestMapping(value = USER_METHOD, method = RequestMethod.GET)
+ @GetMapping(USER_METHOD)
public DashboardUser[] getUsers() {
logger.debug("getUsers");
return users;
public DashboardUser[] getUsers() {
logger.debug("getUsers");
return users;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
}
@ApiOperation(value = "Gets the ANR client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
}
@ApiOperation(value = "Gets the ANR client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
- @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+ @GetMapping(VERSION_METHOD)
public SuccessTransport getClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
}
@ApiOperation(value = "Performs a liveness probe on the ANR xApp, result expressed as the response code.")
public SuccessTransport getClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
}
@ApiOperation(value = "Performs a liveness probe on the ANR xApp, result expressed as the response code.")
- @RequestMapping(value = HEALTH_ALIVE_METHOD, method = RequestMethod.GET)
+ @GetMapping(HEALTH_ALIVE_METHOD)
public void getHealthAlive(HttpServletResponse response) {
logger.debug("getHealthAlive");
healthApi.getHealthAlive();
public void getHealthAlive(HttpServletResponse response) {
logger.debug("getHealthAlive");
healthApi.getHealthAlive();
}
@ApiOperation(value = "Performs a readiness probe on the ANR xApp, result expressed as the response code.")
}
@ApiOperation(value = "Performs a readiness probe on the ANR xApp, result expressed as the response code.")
- @RequestMapping(value = HEALTH_READY_METHOD, method = RequestMethod.GET)
+ @GetMapping(HEALTH_READY_METHOD)
public void getHealthReady(HttpServletResponse response) {
logger.debug("getHealthReady");
healthApi.getHealthReady();
public void getHealthReady(HttpServletResponse response) {
logger.debug("getHealthReady");
healthApi.getHealthReady();
}
@ApiOperation(value = "Returns list of gNodeB IDs based on NCRT in ANR", response = GgNodeBTable.class)
}
@ApiOperation(value = "Returns list of gNodeB IDs based on NCRT in ANR", response = GgNodeBTable.class)
- @RequestMapping(value = GNODEBS_METHOD, method = RequestMethod.GET)
+ @GetMapping(GNODEBS_METHOD)
public GgNodeBTable getGnodebs() {
logger.debug("getGnodebs");
return ncrtApi.getgNodeB();
}
@ApiOperation(value = "Returns neighbor cell relation table for all gNodeBs or based on query parameters", response = NeighborCellRelationTable.class)
public GgNodeBTable getGnodebs() {
logger.debug("getGnodebs");
return ncrtApi.getgNodeB();
}
@ApiOperation(value = "Returns neighbor cell relation table for all gNodeBs or based on query parameters", response = NeighborCellRelationTable.class)
- @RequestMapping(value = NCRT_METHOD, method = RequestMethod.GET)
+ @GetMapping(NCRT_METHOD)
public NeighborCellRelationTable getNcrt( //
@RequestParam(name = QP_NODEB, required = false) String ggnbId, //
@RequestParam(name = QP_SERVING, required = false) String servingCellNrcgi, //
public NeighborCellRelationTable getNcrt( //
@RequestParam(name = QP_NODEB, required = false) String ggnbId, //
@RequestParam(name = QP_SERVING, required = false) String servingCellNrcgi, //
// /ncrt/servingcells/{servCellNrcgi}/neighborcells/{neighCellNrpci} :
@ApiOperation(value = "Modify neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI")
// /ncrt/servingcells/{servCellNrcgi}/neighborcells/{neighCellNrpci} :
@ApiOperation(value = "Modify neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI")
- @RequestMapping(value = NCRT_METHOD + "/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR
- + "}", method = RequestMethod.PUT)
+ @PutMapping(NCRT_METHOD + "/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR + "}")
public void modifyNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, //
@PathVariable(PP_NEIGHBOR) String neighborCellNrpci, //
@RequestBody NeighborCellRelationMod ncrMod, HttpServletResponse response) {
public void modifyNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, //
@PathVariable(PP_NEIGHBOR) String neighborCellNrpci, //
@RequestBody NeighborCellRelationMod ncrMod, HttpServletResponse response) {
}
@ApiOperation(value = "Delete neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI")
}
@ApiOperation(value = "Delete neighbor cell relation based on Serving Cell NRCGI and Neighbor Cell NRPCI")
- @RequestMapping(value = NCRT_METHOD + "/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR
- + "}", method = RequestMethod.DELETE)
+ @DeleteMapping(NCRT_METHOD + "/" + PP_SERVING + "/{" + PP_SERVING + "}/" + PP_NEIGHBOR + "/{" + PP_NEIGHBOR + "}")
public void deleteNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, //
@PathVariable(PP_NEIGHBOR) String neighborCellNrpci, //
HttpServletResponse response) {
public void deleteNcrt(@PathVariable(PP_SERVING) String servingCellNrcgi, //
@PathVariable(PP_NEIGHBOR) String neighborCellNrpci, //
HttpServletResponse response) {
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.RestController;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.ApiOperation;
}
@ApiOperation(value = "Gets the XApp manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
}
@ApiOperation(value = "Gets the XApp manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
- @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+ @GetMapping(VERSION_METHOD)
public SuccessTransport getClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
}
@ApiOperation(value = "Health check of xApp Manager - Liveness probe.")
public SuccessTransport getClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthApi.class));
}
@ApiOperation(value = "Health check of xApp Manager - Liveness probe.")
- @RequestMapping(value = HEALTH_ALIVE_METHOD, method = RequestMethod.GET)
+ @GetMapping(HEALTH_ALIVE_METHOD)
public void getHealth(HttpServletResponse response) {
logger.debug("getHealthAlive");
healthApi.getHealthAlive();
public void getHealth(HttpServletResponse response) {
logger.debug("getHealthAlive");
healthApi.getHealthAlive();
}
@ApiOperation(value = "Readiness check of xApp Manager - Readiness probe.")
}
@ApiOperation(value = "Readiness check of xApp Manager - Readiness probe.")
- @RequestMapping(value = HEALTH_READY_METHOD, method = RequestMethod.GET)
+ @GetMapping(HEALTH_READY_METHOD)
public void getHealthReady(HttpServletResponse response) {
logger.debug("getHealthReady");
healthApi.getHealthReady();
public void getHealthReady(HttpServletResponse response) {
logger.debug("getHealthReady");
healthApi.getHealthReady();
}
@ApiOperation(value = "Returns the configuration of all xapps.", response = AllXappConfig.class)
}
@ApiOperation(value = "Returns the configuration of all xapps.", response = AllXappConfig.class)
- @RequestMapping(value = CONFIG_METHOD, method = RequestMethod.GET)
+ @GetMapping(CONFIG_METHOD)
public AllXappConfig getAllXappConfig() {
logger.debug("getAllXappConfig");
return xappApi.getAllXappConfig();
}
@ApiOperation(value = "Create xApp config.", response = XAppConfig.class)
public AllXappConfig getAllXappConfig() {
logger.debug("getAllXappConfig");
return xappApi.getAllXappConfig();
}
@ApiOperation(value = "Create xApp config.", response = XAppConfig.class)
- @RequestMapping(value = CONFIG_METHOD, method = RequestMethod.POST)
+ @PostMapping(CONFIG_METHOD)
public XAppConfig createXappConfig(@RequestBody XAppConfig xAppConfig) {
logger.debug("createXappConfig {}", xAppConfig);
return xappApi.createXappConfig(xAppConfig);
}
@ApiOperation(value = "Modify xApp config.", response = XAppConfig.class)
public XAppConfig createXappConfig(@RequestBody XAppConfig xAppConfig) {
logger.debug("createXappConfig {}", xAppConfig);
return xappApi.createXappConfig(xAppConfig);
}
@ApiOperation(value = "Modify xApp config.", response = XAppConfig.class)
- @RequestMapping(value = CONFIG_METHOD, method = RequestMethod.PUT)
+ @PutMapping(CONFIG_METHOD)
public XAppConfig modifyXappConfig(@RequestBody XAppConfig xAppConfig) {
logger.debug("modifyXappConfig {}", xAppConfig);
return xappApi.modifyXappConfig(xAppConfig);
}
@ApiOperation(value = "Delete xApp configuration.")
public XAppConfig modifyXappConfig(@RequestBody XAppConfig xAppConfig) {
logger.debug("modifyXappConfig {}", xAppConfig);
return xappApi.modifyXappConfig(xAppConfig);
}
@ApiOperation(value = "Delete xApp configuration.")
- @RequestMapping(value = CONFIG_METHOD + "/{" + PP_XAPP_NAME + "}", method = RequestMethod.DELETE)
+ @DeleteMapping(CONFIG_METHOD + "/{" + PP_XAPP_NAME + "}")
public void deleteXappConfig(@RequestBody ConfigMetadata configMetadata, HttpServletResponse response) {
logger.debug("deleteXappConfig {}", configMetadata);
xappApi.deleteXappConfig(configMetadata);
public void deleteXappConfig(@RequestBody ConfigMetadata configMetadata, HttpServletResponse response) {
logger.debug("deleteXappConfig {}", configMetadata);
xappApi.deleteXappConfig(configMetadata);
}
@ApiOperation(value = "Returns a list of deployable xapps.", response = DashboardDeployableXapps.class)
}
@ApiOperation(value = "Returns a list of deployable xapps.", response = DashboardDeployableXapps.class)
- @RequestMapping(value = XAPPS_LIST_METHOD, method = RequestMethod.GET)
+ @GetMapping(XAPPS_LIST_METHOD)
public Object getAvailableXapps() {
logger.debug("getAvailableXapps");
AllDeployableXapps appNames = xappApi.listAllXapps();
public Object getAvailableXapps() {
logger.debug("getAvailableXapps");
AllDeployableXapps appNames = xappApi.listAllXapps();
}
@ApiOperation(value = "Returns the status of all deployed xapps.", response = AllDeployedXapps.class)
}
@ApiOperation(value = "Returns the status of all deployed xapps.", response = AllDeployedXapps.class)
- @RequestMapping(value = XAPPS_METHOD, method = RequestMethod.GET)
+ @GetMapping(XAPPS_METHOD)
public AllDeployedXapps getDeployedXapps() {
logger.debug("getDeployedXapps");
return xappApi.getAllXapps();
}
@ApiOperation(value = "Returns the status of a given xapp.", response = Xapp.class)
public AllDeployedXapps getDeployedXapps() {
logger.debug("getDeployedXapps");
return xappApi.getAllXapps();
}
@ApiOperation(value = "Returns the status of a given xapp.", response = Xapp.class)
- @RequestMapping(value = XAPPS_METHOD + "/{" + PP_XAPP_NAME + "}", method = RequestMethod.GET)
+ @GetMapping(XAPPS_METHOD + "/{" + PP_XAPP_NAME + "}")
public Xapp getXapp(@PathVariable("xAppName") String xAppName) {
logger.debug("getXapp {}", xAppName);
return xappApi.getXappByName(xAppName);
}
@ApiOperation(value = "Deploy a xapp.", response = Xapp.class)
public Xapp getXapp(@PathVariable("xAppName") String xAppName) {
logger.debug("getXapp {}", xAppName);
return xappApi.getXappByName(xAppName);
}
@ApiOperation(value = "Deploy a xapp.", response = Xapp.class)
- @RequestMapping(value = XAPPS_METHOD, method = RequestMethod.POST)
+ @PostMapping(XAPPS_METHOD)
public Xapp deployXapp(@RequestBody XAppInfo xAppInfo) {
logger.debug("deployXapp {}", xAppInfo);
return xappApi.deployXapp(xAppInfo);
}
@ApiOperation(value = "Undeploy an existing xapp.")
public Xapp deployXapp(@RequestBody XAppInfo xAppInfo) {
logger.debug("deployXapp {}", xAppInfo);
return xappApi.deployXapp(xAppInfo);
}
@ApiOperation(value = "Undeploy an existing xapp.")
- @RequestMapping(value = XAPPS_METHOD + "/{" + PP_XAPP_NAME + "}", method = RequestMethod.DELETE)
+ @DeleteMapping(XAPPS_METHOD + "/{" + PP_XAPP_NAME + "}")
public void undeployXapp(@PathVariable("xAppName") String xAppName, HttpServletResponse response) {
logger.debug("undeployXapp {}", xAppName);
xappApi.undeployXapp(xAppName);
public void undeployXapp(@PathVariable("xAppName") String xAppName, HttpServletResponse response) {
logger.debug("undeployXapp {}", xAppName);
xappApi.undeployXapp(xAppName);
* https://www.springboottutorial.com/spring-boot-exception-handling-for-rest-services
*/
@ControllerAdvice
* https://www.springboottutorial.com/spring-boot-exception-handling-for-rest-services
*/
@ControllerAdvice
-public class CustomizedResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
+public class CustomResponseEntityExceptionHandler extends ResponseEntityExceptionHandler {
- private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+ // Superclass has "logger" that is exposed here, so use a different name
+ private static final Logger log = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
/**
* Generates the response when a REST controller method takes an
/**
* Generates the response when a REST controller method takes an
* @return A response entity with status code 502 plus some details in the body.
*/
@ExceptionHandler(HttpStatusCodeException.class)
* @return A response entity with status code 502 plus some details in the body.
*/
@ExceptionHandler(HttpStatusCodeException.class)
- public final ResponseEntity<?> handleHttpStatusCodeException(HttpStatusCodeException ex, WebRequest request) {
- logger.warn("Request {} failed, status code {}", request.getDescription(false), ex.getStatusCode());
- return new ResponseEntity<ErrorTransport>(
- new ErrorTransport(ex.getRawStatusCode(), ex.getResponseBodyAsString(), ex), HttpStatus.BAD_GATEWAY);
+ public final ResponseEntity<ErrorTransport> handleHttpStatusCodeException(HttpStatusCodeException ex,
+ WebRequest request) {
+ log.warn("Request {} failed, status code {}", request.getDescription(false), ex.getStatusCode());
+ return new ResponseEntity<>(new ErrorTransport(ex.getRawStatusCode(), ex.getResponseBodyAsString(), ex),
+ HttpStatus.BAD_GATEWAY);
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.MediaType;
import org.springframework.util.Assert;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
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.RestController;
import org.springframework.web.client.HttpStatusCodeException;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.HttpStatusCodeException;
}
@ApiOperation(value = "Gets the E2 manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
}
@ApiOperation(value = "Gets the E2 manager client library MANIFEST.MF property Implementation-Version.", response = SuccessTransport.class)
- @RequestMapping(value = VERSION_METHOD, method = RequestMethod.GET)
+ @GetMapping(VERSION_METHOD)
public SuccessTransport getClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthCheckApi.class));
}
@ApiOperation(value = "Gets the health from the E2 manager, expressed as the response code.")
public SuccessTransport getClientVersion() {
return new SuccessTransport(200, DashboardApplication.getImplementationVersion(HealthCheckApi.class));
}
@ApiOperation(value = "Gets the health from the E2 manager, expressed as the response code.")
- @RequestMapping(value = HEALTH_METHOD, method = RequestMethod.GET)
+ @GetMapping(HEALTH_METHOD)
public void healthGet(HttpServletResponse response) {
logger.debug("healthGet");
e2HealthCheckApi.healthGet();
public void healthGet(HttpServletResponse response) {
logger.debug("healthGet");
e2HealthCheckApi.healthGet();
// This calls other methods to simplify the task of the front-end.
@ApiOperation(value = "Gets all RAN identities and statuses from the E2 manager.", response = RanDetailsTransport.class, responseContainer = "List")
// This calls other methods to simplify the task of the front-end.
@ApiOperation(value = "Gets all RAN identities and statuses from the E2 manager.", response = RanDetailsTransport.class, responseContainer = "List")
- @RequestMapping(value = RAN_METHOD, method = RequestMethod.GET)
+ @GetMapping(RAN_METHOD)
public List<RanDetailsTransport> getRanDetails() {
logger.debug("getRanDetails");
// TODO: remove mock when e2mgr delivers the getNodebIdList() method
public List<RanDetailsTransport> getRanDetails() {
logger.debug("getRanDetails");
// TODO: remove mock when e2mgr delivers the getNodebIdList() method
}
@ApiOperation(value = "Get RAN identities list.", response = NodebIdentity.class, responseContainer = "List")
}
@ApiOperation(value = "Get RAN identities list.", response = NodebIdentity.class, responseContainer = "List")
- @RequestMapping(value = NODEB_LIST_METHOD, method = RequestMethod.GET)
+ @GetMapping(NODEB_LIST_METHOD)
public List<NodebIdentity> getNodebIdList() {
logger.debug("getNodebIdList");
return e2NodebApi.getNodebIdList();
}
@ApiOperation(value = "Get RAN by name.", response = GetNodebResponse.class)
public List<NodebIdentity> getNodebIdList() {
logger.debug("getNodebIdList");
return e2NodebApi.getNodebIdList();
}
@ApiOperation(value = "Get RAN by name.", response = GetNodebResponse.class)
- @RequestMapping(value = NODEB_METHOD + "/{" + PP_RANNAME + "}", method = RequestMethod.GET)
+ @GetMapping(NODEB_METHOD + "/{" + PP_RANNAME + "}")
public GetNodebResponse getNb(@PathVariable(PP_RANNAME) String ranName) {
logger.debug("getNb {}", ranName);
return e2NodebApi.getNb(ranName);
}
@ApiOperation(value = "Close all connections to the RANs and delete the data from the nodeb-rnib DB.")
public GetNodebResponse getNb(@PathVariable(PP_RANNAME) String ranName) {
logger.debug("getNb {}", ranName);
return e2NodebApi.getNb(ranName);
}
@ApiOperation(value = "Close all connections to the RANs and delete the data from the nodeb-rnib DB.")
- @RequestMapping(value = NODEB_METHOD, method = RequestMethod.DELETE)
+ @DeleteMapping(NODEB_METHOD)
public void nodebDelete(HttpServletResponse response) {
logger.debug("nodebDelete");
e2NodebApi.nodebDelete();
public void nodebDelete(HttpServletResponse response) {
logger.debug("nodebDelete");
e2NodebApi.nodebDelete();
}
@ApiOperation(value = "Sets up an EN-DC RAN connection via the E2 manager.")
}
@ApiOperation(value = "Sets up an EN-DC RAN connection via the E2 manager.")
- @RequestMapping(value = ENDC_SETUP_METHOD, method = RequestMethod.POST)
+ @PostMapping(ENDC_SETUP_METHOD)
public void endcSetup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
logger.debug("endcSetup {}", setupRequest);
e2NodebApi.endcSetup(setupRequest);
public void endcSetup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
logger.debug("endcSetup {}", setupRequest);
e2NodebApi.endcSetup(setupRequest);
}
@ApiOperation(value = "Sets up an X2 RAN connection via the E2 manager.")
}
@ApiOperation(value = "Sets up an X2 RAN connection via the E2 manager.")
- @RequestMapping(value = X2_SETUP_METHOD, method = RequestMethod.POST)
+ @PostMapping(X2_SETUP_METHOD)
public void x2Setup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
logger.debug("x2Setup {}", setupRequest);
e2NodebApi.x2Setup(setupRequest);
public void x2Setup(@RequestBody SetupRequest setupRequest, HttpServletResponse response) {
logger.debug("x2Setup {}", setupRequest);
e2NodebApi.x2Setup(setupRequest);
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.util.Assert;
import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.util.Assert;
-import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.context.request.ServletWebRequest;
import org.springframework.web.context.request.WebRequest;
* HttpServletRequest
* @return Map of String to Object
*/
* HttpServletRequest
* @return Map of String to Object
*/
- @RequestMapping(ERROR_PATH)
+ @GetMapping(ERROR_PATH)
public Map<String, Object> error(HttpServletRequest aRequest) {
Map<String, Object> body = getErrorAttributes(aRequest, getTraceParameter(aRequest));
logger.warn("Failed in request for {}", body.get("path"));
public Map<String, Object> error(HttpServletRequest aRequest) {
Map<String, Object> body = getErrorAttributes(aRequest, getTraceParameter(aRequest));
logger.warn("Failed in request for {}", body.get("path"));
if (nodebIdentity == null) {
if (other.nodebIdentity != null)
return false;
if (nodebIdentity == null) {
if (other.nodebIdentity != null)
return false;
- } else if (!nodebIdentity.equals(other.nodebIdentity))
+ } else if (!nodebIdentity.equals(other.nodebIdentity)) {
if (nodebStatus == null) {
if (other.nodebStatus != null)
return false;
if (nodebStatus == null) {
if (other.nodebStatus != null)
return false;
- } else if (!nodebStatus.equals(other.nodebStatus))
+ } else if (!nodebStatus.equals(other.nodebStatus)) {
<name>RIC Dashboard Webapp frontend</name>
<build>
<plugins>
<name>RIC Dashboard Webapp frontend</name>
<build>
<plugins>
- <!-- do not deploy anything -->
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-deploy-plugin</artifactId>
- <!-- spring sets the <version>2.8</version> -->
- <configuration>
- <skip>true</skip>
- </configuration>
- </plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>license-maven-plugin</artifactId>