summaryrefslogtreecommitdiffstats
path: root/so-monitoring/so-monitoring-service/src/main
diff options
context:
space:
mode:
authorwaqas.ikram <waqas.ikram@est.tech>2021-02-18 10:43:20 +0000
committerwaqas.ikram <waqas.ikram@est.tech>2021-02-18 11:05:55 +0000
commitbb9977b738bcb0ff5436f519da0e88017e42573d (patch)
treee3fe100abf42b2a0e432b3cfb898cabddbd77956 /so-monitoring/so-monitoring-service/src/main
parent48997934fa955d2b89eab9742634e4251113e6bf (diff)
Removing so-monitoring module
Change-Id: I2b6ef2fd61d08925696cde63c53f16dd87700d52 Issue-ID: SO-3487 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
Diffstat (limited to 'so-monitoring/so-monitoring-service/src/main')
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/JerseyConfiguration.java39
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java38
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java234
-rw-r--r--so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java36
-rw-r--r--so-monitoring/so-monitoring-service/src/main/resources/application.yaml31
-rw-r--r--so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12bin4071 -> 0 bytes
-rw-r--r--so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jksbin1413 -> 0 bytes
7 files changed, 0 insertions, 378 deletions
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/JerseyConfiguration.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/JerseyConfiguration.java
deleted file mode 100644
index 22a1583fc2..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/JerseyConfiguration.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-package org.onap.so.monitoring.rest.api;
-
-import javax.annotation.PostConstruct;
-import javax.ws.rs.ApplicationPath;
-import org.glassfish.jersey.server.ResourceConfig;
-import org.springframework.context.annotation.Configuration;
-
-/**
- * @author waqas.ikram@ericsson.com
- */
-@Configuration
-@ApplicationPath("/so/monitoring")
-public class JerseyConfiguration extends ResourceConfig {
-
- @PostConstruct
- public void setUp() {
- register(SoMonitoringController.class);
- }
-
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
deleted file mode 100644
index aff4fecfdc..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringApplication.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * ONAP - SO
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.so.monitoring.rest.api;
-
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;
-
-/**
- * @author waqas.ikram@ericsson.com
- */
-@SpringBootApplication(scanBasePackages = {"org.onap"}, exclude = SecurityAutoConfiguration.class)
-public class SoMonitoringApplication {
-
- public static void main(String[] args) {
- SpringApplication.run(SoMonitoringApplication.class, args);
-
- }
-
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
deleted file mode 100644
index 5a5a4143fa..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-package org.onap.so.monitoring.rest.api;
-
-import com.google.common.base.Optional;
-import java.util.List;
-import java.util.Map;
-import javax.ws.rs.GET;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import org.onap.so.monitoring.db.service.DatabaseServiceProvider;
-import org.onap.so.monitoring.model.ActivityInstanceDetail;
-import org.onap.so.monitoring.model.ProcessDefinitionDetail;
-import org.onap.so.monitoring.model.ProcessInstanceDetail;
-import org.onap.so.monitoring.model.ProcessInstanceIdDetail;
-import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
-import org.onap.so.monitoring.model.SoInfraRequest;
-import org.onap.so.monitoring.rest.service.CamundaProcessDataServiceProvider;
-import org.onap.so.rest.exceptions.InvalidRestRequestException;
-import org.onap.so.rest.exceptions.HttpResouceNotFoundException;
-import org.onap.so.rest.exceptions.RestProcessingException;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Component;
-
-/**
- * @author waqas.ikram@ericsson.com
- */
-@Component
-@Path("/")
-public class SoMonitoringController {
-
- private static final String INVALID_PROCESS_INSTANCE_ERROR_MESSAGE = "Invalid process instance id: ";
-
- private static final Logger LOGGER = LoggerFactory.getLogger(SoMonitoringController.class);
-
- private final DatabaseServiceProvider databaseServiceProvider;
-
- private final CamundaProcessDataServiceProvider camundaProcessDataServiceProvider;
-
- @Autowired
- public SoMonitoringController(final DatabaseServiceProvider databaseServiceProvider,
- final CamundaProcessDataServiceProvider camundaProcessDataServiceProvider) {
- this.databaseServiceProvider = databaseServiceProvider;
- this.camundaProcessDataServiceProvider = camundaProcessDataServiceProvider;
- }
-
- @GET
- @Path("/process-instance-id/{requestId}")
- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- public Response getProcessInstanceId(final @PathParam("requestId") String requestId) {
- if (requestId == null || requestId.isEmpty()) {
- return Response.status(Status.BAD_REQUEST).entity("Invalid Request id: " + requestId).build();
- }
- try {
- final Optional<ProcessInstanceIdDetail> processInstanceId =
- camundaProcessDataServiceProvider.getProcessInstanceIdDetail(requestId);
- if (processInstanceId.isPresent()) {
- return Response.status(Status.OK).entity(processInstanceId.get()).build();
- }
-
- LOGGER.error("Unable to find process instance id for : {} ", requestId);
- return Response.status(Status.NO_CONTENT).build();
-
- } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
- final String message = "Unable to find process instance id for : " + requestId;
- LOGGER.error(message);
- return Response.status(Status.BAD_REQUEST).entity(message).build();
- } catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to process request for id: " + requestId;
- LOGGER.error(message);
- return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
- }
- }
-
- @GET
- @Path("/process-instance/{processInstanceId}")
- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- public Response getSingleProcessInstance(final @PathParam("processInstanceId") String processInstanceId) {
- if (processInstanceId == null || processInstanceId.isEmpty()) {
- return Response.status(Status.BAD_REQUEST)
- .entity(INVALID_PROCESS_INSTANCE_ERROR_MESSAGE + processInstanceId).build();
- }
- try {
- final Optional<ProcessInstanceDetail> processInstanceDetail =
- camundaProcessDataServiceProvider.getSingleProcessInstanceDetail(processInstanceId);
- if (processInstanceDetail.isPresent()) {
- return Response.status(Status.OK).entity(processInstanceDetail.get()).build();
- }
-
- LOGGER.error("Unable to find process instance id for : {}", processInstanceId);
- return Response.status(Status.NO_CONTENT).build();
-
- } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
- final String message = "Unable to find process instance id for : " + processInstanceId;
- LOGGER.error(message);
- return Response.status(Status.BAD_REQUEST).entity(message).build();
- } catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to process request for id: " + processInstanceId;
- LOGGER.error(message);
- return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
- }
- }
-
- @GET
- @Path("/process-definition/{processDefinitionId}")
- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- public Response getProcessDefinitionXml(final @PathParam("processDefinitionId") String processDefinitionId) {
- if (processDefinitionId == null || processDefinitionId.isEmpty()) {
- return Response.status(Status.BAD_REQUEST).entity("Invalid process definition id: " + processDefinitionId)
- .build();
- }
- try {
- final Optional<ProcessDefinitionDetail> response =
- camundaProcessDataServiceProvider.getProcessDefinition(processDefinitionId);
- if (response.isPresent()) {
- final ProcessDefinitionDetail definitionDetail = response.get();
- return Response.status(Status.OK).entity(definitionDetail).build();
- }
- LOGGER.error("Unable to find process definition xml for processDefinitionId: {}", processDefinitionId);
- return Response.status(Status.NO_CONTENT).build();
-
- } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
- final String message =
- "Unable to find process definition xml for processDefinitionId: {}" + processDefinitionId;
- return Response.status(Status.BAD_REQUEST).entity(message).build();
- } catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to get process definition xml for id: " + processDefinitionId;
- LOGGER.error(message);
- return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
- }
- }
-
- @GET
- @Path("/activity-instance/{processInstanceId}")
- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- public Response getActivityInstanceDetail(final @PathParam("processInstanceId") String processInstanceId) {
- if (processInstanceId == null || processInstanceId.isEmpty()) {
- return Response.status(Status.BAD_REQUEST)
- .entity(INVALID_PROCESS_INSTANCE_ERROR_MESSAGE + processInstanceId).build();
- }
- try {
- final List<ActivityInstanceDetail> activityInstanceDetails =
- camundaProcessDataServiceProvider.getActivityInstance(processInstanceId);
- return Response.status(Status.OK).entity(activityInstanceDetails).build();
- } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
- final String message = "Unable to find activity instance for processInstanceId: " + processInstanceId;
- LOGGER.error(message);
- return Response.status(Status.BAD_REQUEST).entity(message).build();
- } catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to get activity instance detail for id: " + processInstanceId;
- LOGGER.error(message);
- return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
- }
- }
-
- @GET
- @Path("/variable-instance/{processInstanceId}")
- @Produces(MediaType.APPLICATION_JSON)
- public Response getProcessInstanceVariables(final @PathParam("processInstanceId") String processInstanceId) {
- if (processInstanceId == null || processInstanceId.isEmpty()) {
- return Response.status(Status.BAD_REQUEST)
- .entity(INVALID_PROCESS_INSTANCE_ERROR_MESSAGE + processInstanceId).build();
- }
- try {
- final List<ProcessInstanceVariableDetail> processInstanceVariable =
- camundaProcessDataServiceProvider.getProcessInstanceVariable(processInstanceId);
- return Response.status(Status.OK).entity(processInstanceVariable).build();
- } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
- final String message =
- "Unable to find process instance variables for processInstanceId: " + processInstanceId;
- LOGGER.error(message);
- return Response.status(Status.BAD_REQUEST).entity(message).build();
- } catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to get process instance variables for id: " + processInstanceId;
- LOGGER.error(message);
- return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
- }
- }
-
- @POST
- @Path("/v1/search")
- @Produces({MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML})
- public Response getInfraActiveRequests(final Map<String, String[]> filters,
- @QueryParam("from") final long startTime, @QueryParam("to") final long endTime,
- @QueryParam("maxResult") final Integer maxResult) {
-
- if (filters == null) {
- return Response.status(Status.BAD_REQUEST).entity("Invalid filters: " + filters).build();
- }
- try {
- final List<SoInfraRequest> requests =
- databaseServiceProvider.getSoInfraRequest(filters, startTime, endTime, maxResult);
- LOGGER.info("result size: {}", requests.size());
- return Response.status(Status.OK).entity(requests).build();
-
- } catch (final InvalidRestRequestException | HttpResouceNotFoundException extensions) {
- final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
- + ", to: " + endTime + ", maxResult: " + maxResult;
- LOGGER.error(message);
- return Response.status(Status.BAD_REQUEST).entity(message).build();
- } catch (final RestProcessingException restProcessingException) {
- final String message = "Unable to search request for filters: " + filters + ", from: " + startTime
- + ", to: " + endTime + ", maxResult: " + maxResult;
- LOGGER.error(message);
- return Response.status(Status.INTERNAL_SERVER_ERROR).entity(message).build();
- }
- }
-
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java b/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
deleted file mode 100644
index cadd60b0d9..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/WebApplicationConfig.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2018 Ericsson. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-package org.onap.so.monitoring.rest.api;
-
-import org.springframework.context.annotation.Configuration;
-import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
-import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
-
-/**
- * @author waqas.ikram@ericsson.com
- */
-@Configuration
-public class WebApplicationConfig extends WebMvcConfigurerAdapter {
- @Override
- public void addViewControllers(final ViewControllerRegistry registry) {
- super.addViewControllers(registry);
- registry.addViewController("/details/**").setViewName("forward:/");
- }
-}
diff --git a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml b/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
deleted file mode 100644
index c57d79c75b..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/resources/application.yaml
+++ /dev/null
@@ -1,31 +0,0 @@
-server:
- ssl:
- keyStore: classpath:org.onap.so.p12
- keyStorePassword: 6IxlmmPs:HqNhzVP#VFuSs,%
- trustStore: classpath:org.onap.so.trust.jks
- trustStorePassword: 72z0TFN&xfSR;;&NrIP^QB,^
- port: 9091
- tomcat:
- max-threads: 50
-camunda:
- rest:
- api:
- url: http://so-bpmn-infra.onap:8081/sobpmnengine/engine/
- engine: default
- auth: Basic YXBpaEJwbW46cGFzc3dvcmQxJA==
-mso:
- database:
- rest:
- api:
- url: http://so-request-db-adapter.onap:8083/infraActiveRequests/
- auth: Basic YnBlbDpwYXNzd29yZDEk
-
-spring:
- main:
- allow-bean-definition-overriding: true
- security:
- usercredentials:
- -
- username: demo
- password: '$2a$10$ndkDhATUid4a3g0JJVRv2esX4rtB.vzCn7iBhKyR1qZ/wDdvNzjTS'
- role: GUI-Client
diff --git a/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12 b/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12
deleted file mode 100644
index 8fa921a884..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.p12
+++ /dev/null
Binary files differ
diff --git a/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jks b/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jks
deleted file mode 100644
index 39c310e27e..0000000000
--- a/so-monitoring/so-monitoring-service/src/main/resources/org.onap.so.trust.jks
+++ /dev/null
Binary files differ