* ================================================================================
* Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved.
* ================================================================================
+ * Modifications Copyright 2019 Nokia
+ * ================================================================================
* 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.
import org.mockito.junit.MockitoJUnitRunner;
import org.onap.so.cloud.CloudConfig;
import org.onap.so.db.catalog.beans.CloudSite;
+import org.onap.so.db.catalog.beans.ServerType;
import org.onap.so.openstack.exceptions.MsoCloudSiteNotFound;
@RunWith(MockitoJUnitRunner.class)
@Mock
private CloudConfig cloudConfig;
+ @Mock
+ private MsoKeystoneUtils msoKeystoneUtils;
+ @Mock
+ private MsoKeystoneV3Utils msoKeystoneV3Utils;
@InjectMocks
private MsoTenantUtilsFactory msoTenantUtilsFactory;
// THEN
assertThat(tenantUtils).isNull();
}
+
+ @Test
+ public void getTenantUtils_shouldReturnKeystoneUtils_forKeystoneServerType() throws MsoCloudSiteNotFound {
+ shouldReturnAppropriateUtilsInstanceForGivenServerType(ServerType.KEYSTONE, msoKeystoneUtils);
+ }
+
+ @Test
+ public void getTenantUtils_shouldReturnKeystoneV3Utils_forKeystoneV3ServerType() throws MsoCloudSiteNotFound {
+ shouldReturnAppropriateUtilsInstanceForGivenServerType(ServerType.KEYSTONE_V3, msoKeystoneV3Utils);
+ }
+
+ private <T extends MsoTenantUtils> void shouldReturnAppropriateUtilsInstanceForGivenServerType(
+ ServerType serverType, T expectedInstance) throws MsoCloudSiteNotFound {
+ // GIVEN
+ String cloudSiteId = "CloudSiteId";
+ CloudSite cloudSite = mock(CloudSite.class, RETURNS_DEEP_STUBS);
+ given(cloudSite.getIdentityService().getIdentityServerType()).willReturn(serverType);
+ given(cloudConfig.getCloudSite(cloudSiteId)).willReturn(Optional.of(cloudSite));
+
+ // WHEN
+ MsoTenantUtils tenantUtils = msoTenantUtilsFactory.getTenantUtils(cloudSiteId);
+
+ // THEN
+ assertThat(tenantUtils).isEqualTo(expectedInstance);
+ }
}
execution.setVariable("failedActivity", "AAI")
try {
- def transactionLoggingUuid = UUID.randomUUID().toString()
AAIRestClientImpl client = new AAIRestClientImpl()
AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
aaiUpdator.setClient(client)
def vnfId = execution.getVariable("vnfId")
if (inMaint) {
- aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToLocked(vnfId)
execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
}
else {
- aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToUnLocked(vnfId)
}
msoLogger.trace('Exited ' + method)
msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
- //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
}
}
execution.setVariable("failedActivity", "AAI")
try {
- def transactionLoggingUuid = UUID.randomUUID().toString()
AAIRestClientImpl client = new AAIRestClientImpl()
AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
aaiUpdator.setClient(client)
def vnfId = execution.getVariable("vnfId")
if (inMaint) {
- aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToLocked(vnfId)
execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
}
else {
- aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToUnLocked(vnfId)
}
msoLogger.trace('Exited ' + method)
msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
- //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
}
}
execution.setVariable("failedActivity", "AAI")
try {
- def transactionLoggingUuid = UUID.randomUUID().toString()
AAIRestClientImpl client = new AAIRestClientImpl()
AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
aaiUpdator.setClient(client)
def vnfId = execution.getVariable("vnfId")
if (inMaint) {
- aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToLocked(vnfId)
execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
}
else {
- aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToUnLocked(vnfId)
}
msoLogger.trace('Exited ' + method)
msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
- //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
}
}
execution.setVariable("failedActivity", "AAI")
try {
- def transactionLoggingUuid = UUID.randomUUID().toString()
AAIRestClientImpl client = new AAIRestClientImpl()
AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
aaiUpdator.setClient(client)
def vnfId = execution.getVariable("vnfId")
if (inMaint) {
- aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToLocked(vnfId)
execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
}
else {
- aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToUnLocked(vnfId)
}
msoLogger.trace('Exited ' + method)
msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
- //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
}
}
execution.setVariable("failedActivity", "AAI")
try {
- def transactionLoggingUuid = UUID.randomUUID().toString()
AAIRestClientImpl client = new AAIRestClientImpl()
AAIUpdatorImpl aaiUpdator = new AAIUpdatorImpl()
aaiUpdator.setClient(client)
def vnfId = execution.getVariable("vnfId")
if (inMaint) {
- aaiUpdator.updateVnfToLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToLocked(vnfId)
execution.setVariable("rollbackSetVnfInMaintenanceFlag", true)
}
else {
- aaiUpdator.updateVnfToUnLocked(vnfId, transactionLoggingUuid)
+ aaiUpdator.updateVnfToUnLocked(vnfId)
}
msoLogger.trace('Exited ' + method)
msoLogger.error(MessageEnum.BPMN_GENERAL_EXCEPTION_ARG, 'Caught exception in ' + method, "BPMN", MsoLogger.getServiceName(), MsoLogger.ErrorCode.UnknownError, "Exception is:\n" + e);
execution.setVariable("errorCode", "1002")
execution.setVariable("errorText", e.getMessage())
- //exceptionUtil.buildAndThrowWorkflowException(execution, 1002, 'Error in setVnfInMaintFlagInAAI(): ' + e.getMessage())
}
}
List<Pserver> getPhysicalServerByVnfId(String vnfId) throws IOException;
- void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) throws Exception;
+ void updateMaintenceFlagVnfId(String vnfId, boolean inMaint) throws Exception;
GenericVnf getVnfByName(String vnfId);
}
@Override
- public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint, String transactionLoggingUuid) {
+ public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint) {
GenericVnf genericVnf = new GenericVnf();
genericVnf.setInMaint(inMaint);
new AAIResourcesClient()
package org.onap.so.client.aai;
-import java.io.IOException;
-
public interface AAIUpdator {
- void updateVnfToLocked(String vnfName, String uuid) throws IOException, Exception;
+ void updateVnfToLocked(String vnfName) throws Exception;
- void updateVnfToUnLocked(String vnfName, String uuid) throws IOException, Exception;
+ void updateVnfToUnLocked(String vnfName) throws Exception;
}
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
-
public class AAIUpdatorImpl implements AAIUpdator {
@Autowired
}
@Override
- public void updateVnfToLocked(String vnfId, String uuid) throws Exception {
- client.updateMaintenceFlagVnfId(vnfId, true, uuid);
+ public void updateVnfToLocked(String vnfId) throws Exception {
+ client.updateMaintenceFlagVnfId(vnfId, true);
}
@Override
- public void updateVnfToUnLocked(String vnfId, String uuid) throws Exception {
- client.updateMaintenceFlagVnfId(vnfId, false, uuid);
+ public void updateVnfToUnLocked(String vnfId) throws Exception {
+ client.updateMaintenceFlagVnfId(vnfId, false);
}
}
@Test(expected = NullPointerException.class)
public void updateVnfToLockedTest() throws Exception {
- test.updateVnfToLocked("vnfId","uuId");
+ test.updateVnfToLocked("vnfId");
}
@Test(expected = NullPointerException.class)
public void updateVnfToUnLockedTest() throws Exception {
- test.updateVnfToUnLocked("vnfId","uuId");
+ test.updateVnfToUnLocked("vnfId");
}
}
@Mock
protected AAIRestClientI client;
String vnfName = "testVnf";
- String uuid = "UUID";
AAIUpdatorImpl updator;
@Before
@Test
public void testUpdateVnfToLocked() throws Exception{
- doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class), isA(String.class));
- updator.updateVnfToLocked(vnfName, uuid);
- verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, true, uuid);
+ doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class));
+ updator.updateVnfToLocked(vnfName);
+ verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, true);
}
@Test
public void testUpdateVnfToUnLocked() throws Exception {
- doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class), isA(String.class));
- updator.updateVnfToUnLocked(vnfName, uuid);
- verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, false, uuid);
+ doNothing().when(client).updateMaintenceFlagVnfId(isA(String.class), isA(Boolean.class));
+ updator.updateVnfToUnLocked(vnfName);
+ verify(client, times(1)).updateMaintenceFlagVnfId(vnfName, false);
}
}
\ No newline at end of file
return processResponseFromSubsystem(result,subsystem);
}catch(Exception ex){
- msoLogger.error(ex.getMessage());
+ msoLogger.error("Exception occured in GlobalHealthcheckHandler.querySubsystemHealth() "+ ex);
return HealthcheckStatus.DOWN.toString();
}
}
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.camunda.model;
+package org.onap.so.monitoring.camunda.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.camunda.model;
+package org.onap.so.monitoring.camunda.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.camunda.model;
+package org.onap.so.monitoring.camunda.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.camunda.model;
+package org.onap.so.monitoring.camunda.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
import com.fasterxml.jackson.annotation.JsonIgnore;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.camunda.model;
+package org.onap.so.monitoring.camunda.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.camunda;
+package org.onap.so.monitoring.configuration.camunda;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.camunda;
+package org.onap.so.monitoring.configuration.camunda;
import java.net.URI;
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.database;
+package org.onap.so.monitoring.configuration.database;
import org.springframework.beans.factory.annotation.Value;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.database;
+package org.onap.so.monitoring.configuration.database;
import java.net.URI;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.rest;
+package org.onap.so.monitoring.configuration.rest;
import java.io.IOException;
--- /dev/null
+/*-
+ * ============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.configuration.rest;
+
+import org.springframework.boot.web.servlet.FilterRegistrationBean;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.core.Ordered;
+import org.springframework.web.cors.CorsConfiguration;
+import org.springframework.web.cors.UrlBasedCorsConfigurationSource;
+import org.springframework.web.filter.CorsFilter;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * @author waqas.ikram@ericsson, eoin.hanan@ericsson.com
+ */
+@Configuration
+public class CorsConfigurer {
+
+ @Bean
+ public CorsFilter corsFilter() {
+ UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource();
+ CorsConfiguration config = new CorsConfiguration();
+ config.setAllowCredentials(true);
+ config.addAllowedOrigin("*");
+ config.addAllowedHeader("*");
+ config.addAllowedMethod("*");
+ source.registerCorsConfiguration("/**", config);
+ return new CorsFilter(source);
+ }
+}
+
+
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.rest;
+package org.onap.so.monitoring.configuration.rest;
import java.util.concurrent.TimeUnit;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.rest;
+package org.onap.so.monitoring.configuration.rest;
-import static org.onap.so.montoring.configuration.rest.RestTemplateConfigration.CAMUNDA_REST_TEMPLATE;
-import static org.onap.so.montoring.configuration.rest.RestTemplateConfigration.DATABASE_REST_TEMPLATE;
+import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.CAMUNDA_REST_TEMPLATE;
+import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.DATABASE_REST_TEMPLATE;
-import org.onap.so.montoring.rest.service.HttpRestServiceProvider;
-import org.onap.so.montoring.rest.service.HttpRestServiceProviderImpl;
+import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.monitoring.rest.service.HttpRestServiceProviderImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.rest;
+package org.onap.so.monitoring.configuration.rest;
import java.util.concurrent.TimeUnit;
* @author waqas.ikram@ericsson.com
*/
@Configuration
-public class RestTemplateConfigration {
+public class RestTemplateConfiguration {
public static final String DATABASE_REST_TEMPLATE = "databaseRestTemplate";
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.db.service;
+package org.onap.so.monitoring.db.service;
import java.util.List;
import java.util.Map;
-import org.onap.so.montoring.model.SoInfraRequest;
+import org.onap.so.monitoring.model.SoInfraRequest;
/**
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.db.service;
+package org.onap.so.monitoring.db.service;
-import static org.onap.so.montoring.configuration.rest.HttpServiceProviderConfiguration.DATABASE_HTTP_REST_SERVICE_PROVIDER;
+import static org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration.DATABASE_HTTP_REST_SERVICE_PROVIDER;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import org.onap.so.montoring.camunda.model.SoActiveInfraRequests;
-import org.onap.so.montoring.configuration.database.DatabaseUrlProvider;
-import org.onap.so.montoring.model.SoInfraRequest;
-import org.onap.so.montoring.model.SoInfraRequestBuilder;
-import org.onap.so.montoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.monitoring.camunda.model.SoActiveInfraRequests;
+import org.onap.so.monitoring.configuration.database.DatabaseUrlProvider;
+import org.onap.so.monitoring.model.SoInfraRequest;
+import org.onap.so.monitoring.model.SoInfraRequestBuilder;
+import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.exception;
+package org.onap.so.monitoring.exception;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.exception;
+package org.onap.so.monitoring.exception;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
/**
* @author waqas.ikram@ericsson.com
*/
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
public class ProcessInstanceVariableDetail {
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
-import static org.onap.so.montoring.utils.ObjectEqualsUtils.isEqual;
+import static org.onap.so.monitoring.utils.ObjectEqualsUtils.isEqual;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.model;
+package org.onap.so.monitoring.model;
import java.sql.Timestamp;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.rest.service;
+package org.onap.so.monitoring.rest.service;
import java.util.List;
-import org.onap.so.montoring.model.ActivityInstanceDetail;
-import org.onap.so.montoring.model.ProcessDefinitionDetail;
-import org.onap.so.montoring.model.ProcessInstanceDetail;
-import org.onap.so.montoring.model.ProcessInstanceIdDetail;
-import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
+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 com.google.common.base.Optional;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.rest.service;
+package org.onap.so.monitoring.rest.service;
-import static org.onap.so.montoring.configuration.rest.HttpServiceProviderConfiguration.CAMUNDA_HTTP_REST_SERVICE_PROVIDER;
+import static org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration.CAMUNDA_HTTP_REST_SERVICE_PROVIDER;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.onap.so.montoring.camunda.model.ActivityInstance;
-import org.onap.so.montoring.camunda.model.ProcessDefinition;
-import org.onap.so.montoring.camunda.model.ProcessInstance;
-import org.onap.so.montoring.camunda.model.ProcessInstanceVariable;
-import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider;
-import org.onap.so.montoring.model.ActivityInstanceDetail;
-import org.onap.so.montoring.model.ProcessDefinitionDetail;
-import org.onap.so.montoring.model.ProcessInstanceDetail;
-import org.onap.so.montoring.model.ProcessInstanceIdDetail;
-import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
+import org.onap.so.monitoring.camunda.model.ActivityInstance;
+import org.onap.so.monitoring.camunda.model.ProcessDefinition;
+import org.onap.so.monitoring.camunda.model.ProcessInstance;
+import org.onap.so.monitoring.camunda.model.ProcessInstanceVariable;
+import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider;
+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.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.rest.service;
+package org.onap.so.monitoring.rest.service;
import com.google.common.base.Optional;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.rest.service;
+package org.onap.so.monitoring.rest.service;
-import org.onap.so.montoring.exception.InvalidRestRequestException;
-import org.onap.so.montoring.exception.RestProcessingException;
+import org.onap.so.monitoring.exception.InvalidRestRequestException;
+import org.onap.so.monitoring.exception.RestProcessingException;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.utils;
+package org.onap.so.monitoring.utils;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration;
+package org.onap.so.monitoring.configuration;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
-import org.onap.so.montoring.configuration.camunda.CamundaConfiguration;
-import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider;
+import org.onap.so.monitoring.configuration.camunda.CamundaConfiguration;
+import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider;
/**
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration;
+package org.onap.so.monitoring.configuration;
import static org.junit.Assert.assertEquals;
import java.util.UUID;
import org.junit.Test;
-import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider;
+import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider;
/**
* @author waqas.ikram@ericsson.com
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration;
+package org.onap.so.monitoring.configuration;
import static org.junit.Assert.assertNotNull;
import org.junit.Test;
-import org.onap.so.montoring.configuration.rest.HttpServiceProviderConfiguration;
-import org.onap.so.montoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.monitoring.configuration.rest.HttpServiceProviderConfiguration;
+import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
import org.springframework.web.client.RestTemplate;
/**
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration;
+package org.onap.so.monitoring.configuration;
import static org.junit.Assert.assertFalse;
@Test
public void test_camunda_module_pojo_classes() throws ClassNotFoundException {
- test("org.onap.so.montoring.camunda.model");
- assertEqualMethod("org.onap.so.montoring.camunda.model");
+ test("org.onap.so.monitoring.camunda.model");
+ assertEqualMethod("org.onap.so.monitoring.camunda.model");
}
@Test
public void test_so_monitoring_pojo_classes() throws ClassNotFoundException {
- test("org.onap.so.montoring.model");
- assertEqualMethod("org.onap.so.montoring.model");
+ test("org.onap.so.monitoring.model");
+ assertEqualMethod("org.onap.so.monitoring.model");
}
public void assertEqualMethod(final String pojoPackage) throws ClassNotFoundException {
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.configuration.database;
+package org.onap.so.monitoring.configuration.database;
import static org.junit.Assert.assertEquals;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.db.api;
+package org.onap.so.monitoring.db.api;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.util.UUID;
import org.junit.Test;
-import org.onap.so.montoring.camunda.model.SoActiveInfraRequests;
-import org.onap.so.montoring.configuration.database.DatabaseUrlProvider;
-import org.onap.so.montoring.db.service.DatabaseServiceProvider;
-import org.onap.so.montoring.db.service.DatabaseServiceProviderImpl;
-import org.onap.so.montoring.model.SoInfraRequest;
-import org.onap.so.montoring.rest.service.HttpRestServiceProvider;
+import org.onap.so.monitoring.camunda.model.SoActiveInfraRequests;
+import org.onap.so.monitoring.configuration.database.DatabaseUrlProvider;
+import org.onap.so.monitoring.db.service.DatabaseServiceProvider;
+import org.onap.so.monitoring.db.service.DatabaseServiceProviderImpl;
+import org.onap.so.monitoring.model.SoInfraRequest;
+import org.onap.so.monitoring.rest.service.HttpRestServiceProvider;
import com.google.common.base.Optional;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.rest.service;
+package org.onap.so.monitoring.rest.service;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import java.util.UUID;
import org.junit.Test;
-import org.onap.so.montoring.camunda.model.ActivityInstance;
-import org.onap.so.montoring.camunda.model.ProcessDefinition;
-import org.onap.so.montoring.camunda.model.ProcessInstance;
-import org.onap.so.montoring.camunda.model.ProcessInstanceVariable;
-import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider;
-import org.onap.so.montoring.model.ActivityInstanceDetail;
-import org.onap.so.montoring.model.ProcessDefinitionDetail;
-import org.onap.so.montoring.model.ProcessInstanceIdDetail;
-import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
+import org.onap.so.monitoring.camunda.model.ActivityInstance;
+import org.onap.so.monitoring.camunda.model.ProcessDefinition;
+import org.onap.so.monitoring.camunda.model.ProcessInstance;
+import org.onap.so.monitoring.camunda.model.ProcessInstanceVariable;
+import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider;
+import org.onap.so.monitoring.model.ActivityInstanceDetail;
+import org.onap.so.monitoring.model.ProcessDefinitionDetail;
+import org.onap.so.monitoring.model.ProcessInstanceIdDetail;
+import org.onap.so.monitoring.model.ProcessInstanceVariableDetail;
import com.google.common.base.Optional;
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
-package org.onap.so.montoring.utils;
+package org.onap.so.monitoring.utils;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
-import org.onap.so.montoring.db.service.DatabaseServiceProvider;
-import org.onap.so.montoring.exception.InvalidRestRequestException;
-import org.onap.so.montoring.exception.RestProcessingException;
-import org.onap.so.montoring.model.ActivityInstanceDetail;
-import org.onap.so.montoring.model.ProcessDefinitionDetail;
-import org.onap.so.montoring.model.ProcessInstanceDetail;
-import org.onap.so.montoring.model.ProcessInstanceIdDetail;
-import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
-import org.onap.so.montoring.model.SoInfraRequest;
-import org.onap.so.montoring.rest.service.CamundaProcessDataServiceProvider;
+import org.onap.so.monitoring.db.service.DatabaseServiceProvider;
+import org.onap.so.monitoring.exception.InvalidRestRequestException;
+import org.onap.so.monitoring.exception.RestProcessingException;
+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.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.onap.so.montoring.configuration.rest.RestTemplateConfigration.CAMUNDA_REST_TEMPLATE;
+import static org.onap.so.monitoring.configuration.rest.RestTemplateConfiguration.CAMUNDA_REST_TEMPLATE;
import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withBadRequest;
import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.onap.so.montoring.configuration.camunda.CamundaRestUrlProvider;
-import org.onap.so.montoring.model.ActivityInstanceDetail;
-import org.onap.so.montoring.model.ProcessDefinitionDetail;
-import org.onap.so.montoring.model.ProcessInstanceDetail;
-import org.onap.so.montoring.model.ProcessInstanceIdDetail;
-import org.onap.so.montoring.model.ProcessInstanceVariableDetail;
+import org.onap.so.monitoring.configuration.camunda.CamundaRestUrlProvider;
+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.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.boot.test.context.SpringBootTest;
import { HttpResponse } from '@angular/common/http';\r
import { PII } from './model/processInstance.model';\r
import { HttpErrorHandlerService } from './http-error-handler.service';\r
+import { ACTINST } from './model/activityInstance.model';\r
\r
\r
@Injectable({\r
}\r
\r
// HTTP GET to return Activity instancs using ProcessInstanceID\r
- getActivityInstance(processInstanceId) {\r
+ getActivityInstance(processInstanceId): Promise<ACTINST[]> {\r
var url = environment.soMonitoringBackendURL + 'activity-instance/' + processInstanceId;\r
- return this.http.get(url)\r
+ return this.http.get<ACTINST[]>(url)\r
.pipe(\r
catchError(this.httpErrorHandlerService.handleError("GET", url))\r
- );\r
+ ).toPromise();\r
}\r
\r
// HTTP GET to return Activity Instance using ProcessInstanceID\r
-<!--\r
-============LICENSE_START=======================================================\r
- Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
- limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
--->\r
-\r
-<div class="completeForm">\r
- <div class="topCanvas">\r
- <section class="canvas" id="canvas"></section>\r
- <mat-card class="besideCanvas" id="besideCanvas">\r
- <mat-card-title>Process Information</mat-card-title>\r
- <br />\r
- <mat-card-content>Process Instance Id: </mat-card-content>\r
- <mat-card-content>{{ processInstanceID }}</mat-card-content>\r
- <br />\r
- <mat-card-content>Process Definition Id: </mat-card-content>\r
- <mat-card-content>{{ processDefinitionID }}</mat-card-content>\r
- <br />\r
- <mat-card-content>Process Definition Name: </mat-card-content>\r
- <mat-card-content>{{ processDefinitionName }}</mat-card-content>\r
- </mat-card>\r
- </div>\r
- <br />\r
-\r
- <div class="example-container mat-elevation-z8">\r
- <mat-tab-group class="tab-group">\r
- <mat-tab label="Activity Instances">\r
- <mat-table [dataSource]="activityInstance">\r
- <ng-container matColumnDef="activityId">\r
- <mat-header-cell *matHeaderCellDef> Activity Id </mat-header-cell>\r
- <mat-cell *matCellDef="let activity"> {{ activity.activityId }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="activityName">\r
- <mat-header-cell *matHeaderCellDef> Activity Name </mat-header-cell>\r
- <mat-cell *matCellDef="let activity">\r
- <div [ngSwitch]="!!activity.calledProcessInstanceId">\r
- <div *ngSwitchCase="false"><a> {{ activity.activityName }} </a></div>\r
- <div *ngSwitchCase="true"><a [routerLink]="['/details', activity.calledProcessInstanceId]"> {{ activity.activityName }} </a></div>\r
- </div>\r
- </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="activityType">\r
- <mat-header-cell *matHeaderCellDef> Activity Type </mat-header-cell>\r
- <mat-cell *matCellDef="let activity"> {{ activity.activityType }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="startTime">\r
- <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell>\r
- <mat-cell *matCellDef="let activity"> {{ activity.startTime }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="endTime">\r
- <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell>\r
- <mat-cell *matCellDef="let activity"> {{ activity.endTime }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="durationInMillis">\r
- <mat-header-cell *matHeaderCellDef> Duration (ms) </mat-header-cell>\r
- <mat-cell *matCellDef="let activity"> {{ activity.durationInMillis }} </mat-cell>\r
- </ng-container>\r
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>\r
- <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>\r
- </mat-table>\r
- </mat-tab>\r
-\r
- <mat-tab label="Variable Instances">\r
- <mat-table [dataSource]="variableInstance">\r
- <ng-container matColumnDef="name">\r
- <mat-header-cell *matHeaderCellDef> Name </mat-header-cell>\r
- <mat-cell *matCellDef="let variable"> {{ variable.name }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="type">\r
- <mat-header-cell *matHeaderCellDef> Type </mat-header-cell>\r
- <mat-cell *matCellDef="let variable"> {{ variable.type }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="value">\r
- <mat-header-cell *matHeaderCellDef> Value </mat-header-cell>\r
- <mat-cell *matCellDef="let variable"> {{ variable.value }} </mat-cell>\r
- </ng-container>\r
- <mat-header-row *matHeaderRowDef="displayedColumnsVariable"></mat-header-row>\r
- <mat-row *matRowDef="let row; columns: displayedColumnsVariable;"></mat-row>\r
- </mat-table>\r
- </mat-tab>\r
- </mat-tab-group>\r
- </div>\r
-</div>\r
-\r
-<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner>\r
+<!--
+============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=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+-->
+
+<div class="completeForm">
+ <div class="topCanvas">
+ <section class="canvas" id="canvas"></section>
+ <mat-card class="besideCanvas" id="besideCanvas">
+ <mat-card-title>Process Information</mat-card-title>
+ <br />
+ <mat-card-content>Process Instance Id: </mat-card-content>
+ <mat-card-content>{{ processInstanceID }}</mat-card-content>
+ <br />
+ <mat-card-content>Process Definition Id: </mat-card-content>
+ <mat-card-content>{{ processDefinitionID }}</mat-card-content>
+ <br />
+ <mat-card-content>Process Definition Name: </mat-card-content>
+ <mat-card-content>{{ processDefinitionName }}</mat-card-content>
+ </mat-card>
+ </div>
+ <br />
+
+ <div class="example-container mat-elevation-z8">
+ <mat-tab-group class="tab-group">
+ <mat-tab label="Activity Instances">
+ <mat-table [dataSource]="activityInstance">
+ <ng-container matColumnDef="activityId">
+ <mat-header-cell *matHeaderCellDef> Activity Id </mat-header-cell>
+ <mat-cell *matCellDef="let activity"> {{ activity.activityId }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="activityName">
+ <mat-header-cell *matHeaderCellDef> Activity Name </mat-header-cell>
+ <mat-cell *matCellDef="let activity">
+ <div [ngSwitch]="!!activity.calledProcessInstanceId">
+ <div *ngSwitchCase="false"><a> {{ activity.activityName }} </a></div>
+ <div *ngSwitchCase="true"><a [routerLink]="['/details', activity.calledProcessInstanceId]"> {{ activity.activityName }} </a></div>
+ </div>
+ </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="activityType">
+ <mat-header-cell *matHeaderCellDef> Activity Type </mat-header-cell>
+ <mat-cell *matCellDef="let activity"> {{ activity.activityType }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="startTime">
+ <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell>
+ <mat-cell *matCellDef="let activity"> {{ (activity.startTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="endTime">
+ <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell>
+ <mat-cell *matCellDef="let activity"> {{ (activity.endTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="durationInMillis">
+ <mat-header-cell *matHeaderCellDef> Duration (ms) </mat-header-cell>
+ <mat-cell *matCellDef="let activity"> {{ activity.durationInMillis }} </mat-cell>
+ </ng-container>
+ <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
+ <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
+ </mat-table>
+ </mat-tab>
+
+ <mat-tab label="Variable Instances">
+ <mat-table [dataSource]="variableInstance">
+ <ng-container matColumnDef="name">
+ <mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
+ <mat-cell *matCellDef="let variable"> {{ variable.name }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="type">
+ <mat-header-cell *matHeaderCellDef> Type </mat-header-cell>
+ <mat-cell *matCellDef="let variable"> {{ variable.type }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="value">
+ <mat-header-cell *matHeaderCellDef> Value </mat-header-cell>
+ <mat-cell *matCellDef="let variable"> {{ variable.value }} </mat-cell>
+ </ng-container>
+ <mat-header-row *matHeaderRowDef="displayedColumnsVariable"></mat-header-row>
+ <mat-row *matRowDef="let row; columns: displayedColumnsVariable;"></mat-row>
+ </mat-table>
+ </mat-tab>
+ </mat-tab-group>
+ </div>
+</div>
+
+<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner>
})\r
\r
export class DetailsComponent implements OnInit {\r
-\r
bpmnViewer: any;\r
\r
processInstanceID: string;\r
constructor(private route: ActivatedRoute, private data: DataService, private popup: ToastrNotificationService,\r
private router: Router, private spinner: NgxSpinnerService) { }\r
\r
- getActInst(procInstId: string) {\r
- this.data.getActivityInstance(procInstId).subscribe(\r
+ async getActInst(procInstId: string) {\r
+ await this.data.getActivityInstance(procInstId).then(\r
(data: ACTINST[]) => {\r
this.activityInstance = data;\r
console.log(data);\r
});\r
}\r
\r
- async getProcInstance(procInstId) {\r
+ async getProcInstance(procInstId) {\r
await this.data.getProcessInstance(procInstId).then(\r
async (data: PII) => {\r
this.processInstance = data;\r
getVarInst(procInstId) {\r
this.data.getVariableInstance(procInstId).subscribe(\r
(data: VarInstance[]) => {\r
- this.variableInstance = data;\r
+ this.variableInstance = [];\r
+ for (let i = 0; i < data.length; i++) {\r
+ var value = data[i]['value'];\r
+ var type = data[i]['type'];\r
+ if ((type == 'Object') && !(value == null)) {\r
+ try {\r
+ data[i]['value'] = JSON.stringify(value, null, 2);\r
+ }\r
+ catch (error) {\r
+ console.log("Unable to \nError Code: " + error);\r
+ }\r
+ }\r
+ this.variableInstance[i] = data[i];\r
+ }\r
console.log(data);\r
}, error => {\r
console.log(error);\r
this.getVarInst(this.processInstanceID);\r
});\r
}\r
+\r
}\r
-<!--\r
-============LICENSE_START=======================================================\r
-Copyright (C) 2018 Ericsson. All rights reserved.\r
-================================================================================\r
-Licensed under the Apache License, Version 2.0 (the "License");\r
-you may not use this file except in compliance with the License.\r
-You may obtain a copy of the License at\r
-\r
- http://www.apache.org/licenses/LICENSE-2.0\r
-\r
-Unless required by applicable law or agreed to in writing, software\r
-distributed under the License is distributed on an "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
-See the License for the specific language governing permissions and\r
-limitations under the License.\r
-\r
-SPDX-License-Identifier: Apache-2.0\r
-============LICENSE_END=========================================================\r
-\r
-@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com\r
--->\r
-\r
-<base href="/">\r
-\r
-<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">\r
-<link rel="stylesheet" ng-href="./home.component.scss">\r
-<div class="completeForm">\r
- <div class="searchArea">\r
-\r
- <!-- Dropdown Filter and TextBox for Service Instance Id -->\r
- <div class="container-home">\r
- <mat-form-field class="selectFilter">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSII" name="sel" placeholder="Select Filter">\r
- <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
- <mat-form-field class="valueInput">\r
- <input matInput #searchValueSII type="text" [(ngModel)]="searchData.serviceInstanceId" placeholder="Service Instance Id">\r
- </mat-form-field>\r
- </div>\r
-\r
- <!-- Dropdown Filter and TextBox for Request Id -->\r
- <div class="container-home">\r
- <mat-form-field class="selectFilter">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueRI" name="sel" placeholder="Select Filter">\r
- <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
- <mat-form-field class="valueInput">\r
- <input matInput #searchValueRI type="text" [(ngModel)]="searchData.requestId" placeholder="Request Id">\r
- </mat-form-field>\r
-\r
- <!-- Angular Start Date Picker -->\r
- <mat-form-field class="startDate">\r
- <input matInput #startDate [matDatepicker]="picker" [(ngModel)]="searchData.startDate" placeholder="Choose a start date">\r
- <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>\r
- <mat-datepicker #picker></mat-datepicker>\r
- </mat-form-field>\r
-\r
- <!-- Dropdown box for Start Hour selection -->\r
- <mat-form-field class="selectHour">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartHour" name="hourFrom" placeholder="Select Hour">\r
- <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
-\r
- <!-- Dropdown box for Start Minute selection -->\r
- <mat-form-field class="selectMinute">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartMinute" name="minuteFrom" placeholder="Select Minute">\r
- <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
- </div>\r
-\r
- <!-- Dropdown Filter and TextBox for Service Name -->\r
- <div class="container-home">\r
- <mat-form-field class="selectFilter">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSN" name="sel" placeholder="Select Filter">\r
- <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
- <mat-form-field class="valueInput">\r
- <input matInput #searchValueSN type="text" [(ngModel)]="searchData.serviceInstanceName" placeholder="Service Name">\r
- </mat-form-field>\r
-\r
- <!-- Angular End Date Picker -->\r
- <mat-form-field class="endDate">\r
- <input matInput #endDate [matDatepicker]="endpicker" [(ngModel)]="searchData.endDate" placeholder="Choose an end date">\r
- <mat-datepicker-toggle matSuffix [for]="endpicker"></mat-datepicker-toggle>\r
- <mat-datepicker #endpicker></mat-datepicker>\r
- </mat-form-field>\r
-\r
- <!-- Dropdown box for End Hour selection -->\r
- <mat-form-field class="selectHour">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndHour" name="hourTo" placeholder="Select Hour">\r
- <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
-\r
- <!-- Dropdown box for End Minute selection -->\r
- <mat-form-field class="selectMinute">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndMinute" name="minuteTo" placeholder="Select Minute">\r
- <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
- </div>\r
-\r
- <!-- Dropdown Filter for Status -->\r
- <div class="container-home">\r
- <mat-form-field class="selectFilter">\r
- <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSTATUS" name="sel" placeholder="Status">\r
- <mat-option *ngFor="let statusOption of statusOptions" [value]="statusOption.value">{{ statusOption.name }}</mat-option>\r
- </mat-select>\r
- </mat-form-field>\r
- </div>\r
- <br />\r
-\r
- <!-- Button to call makeCall() function to commence search based on parameters -->\r
- <button (click)="makeCall()" class="fa fa-search"></button>\r
- </div>\r
-\r
- <br />\r
-\r
- <!-- Table to display selected fields if data present -->\r
- <div class="example-container mat-elevation-z8">\r
- <mat-tab-group class="tab-group">\r
- <mat-tab label="Service Instances">\r
- <mat-table [dataSource]="processData">\r
- <ng-container matColumnDef="requestId">\r
- <mat-header-cell *matHeaderCellDef> Request Id </mat-header-cell>\r
- <mat-cell *matCellDef="let process"><a routerLink="" (click)="getProcessIsntanceId(process.requestId)">{{ process.requestId }}</a></mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="serviceInstanceId">\r
- <mat-header-cell *matHeaderCellDef> Instance Id </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.serviceInstanceId }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="serviceIstanceName">\r
- <mat-header-cell *matHeaderCellDef> Instance Name </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.serviceIstanceName }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="networkId">\r
- <mat-header-cell *matHeaderCellDef> Network Id </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.networkId }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="requestStatus">\r
- <mat-header-cell *matHeaderCellDef> Request Status </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.requestStatus }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="serviceType">\r
- <mat-header-cell *matHeaderCellDef> Service Type </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.serviceType }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="startTime">\r
- <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.startTime }} </mat-cell>\r
- </ng-container>\r
- <ng-container matColumnDef="endTime">\r
- <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell>\r
- <mat-cell *matCellDef="let process"> {{ process.endTime }} </mat-cell>\r
- </ng-container>\r
- <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>\r
- <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>\r
- </mat-table>\r
- </mat-tab>\r
-\r
- <mat-tab label="Service Statistics">\r
- <div id="servStats">\r
- <table class="statsTable">\r
- <tbody>\r
- <tr>\r
- <td>Total: {{ totalVal }}</td>\r
- <td></td>\r
- </tr>\r
- <tr>\r
- <td>Complete: {{ completeVal }}</td>\r
- <td> {{ percentageComplete }}%</td>\r
- </tr>\r
- <tr>\r
- <td>Failed: {{ failedVal }}</td>\r
- <td> {{ percentageFailed }}%</td>\r
- </tr>\r
- <tr>\r
- <td>In Progress: {{ inProgressVal }}</td>\r
- <td> {{ percentageInProg }}%</td>\r
- </tr>\r
- <tr>\r
- <td>Pending: {{ pendingVal }}</td>\r
- <td> {{ percentagePending }}%</td>\r
- </tr>\r
- <tr>\r
- <td>Unlocked: {{ unlockedVal }}</td>\r
- <td> {{ percentageUnlocked }}%</td>\r
- </tr>\r
- </tbody>\r
- </table>\r
- </div>\r
- </mat-tab>\r
- </mat-tab-group>\r
- </div>\r
-</div>\r
-\r
-<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner>\r
-<router-outlet></router-outlet>\r
+<!--
+============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=========================================================
+
+@authors: ronan.kenny@ericsson.com, waqas.ikram@ericsson.com
+-->
+
+<base href="/">
+
+<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
+<link rel="stylesheet" ng-href="./home.component.scss">
+<div class="completeForm">
+ <div class="searchArea">
+
+ <!-- Dropdown Filter and TextBox for Service Instance Id -->
+ <div class="container-home">
+ <mat-form-field class="selectFilter">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSII" name="sel" placeholder="Select Filter">
+ <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ <mat-form-field class="valueInput">
+ <input matInput #searchValueSII type="text" [(ngModel)]="searchData.serviceInstanceId" placeholder="Service Instance Id">
+ </mat-form-field>
+ </div>
+
+ <!-- Dropdown Filter and TextBox for Request Id -->
+ <div class="container-home">
+ <mat-form-field class="selectFilter">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueRI" name="sel" placeholder="Select Filter">
+ <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ <mat-form-field class="valueInput">
+ <input matInput #searchValueRI type="text" [(ngModel)]="searchData.requestId" placeholder="Request Id">
+ </mat-form-field>
+
+ <!-- Angular Start Date Picker -->
+ <mat-form-field class="startDate">
+ <input matInput #startDate [matDatepicker]="picker" [(ngModel)]="searchData.startDate" placeholder="Choose a start date">
+ <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
+ <mat-datepicker #picker></mat-datepicker>
+ </mat-form-field>
+
+ <!-- Dropdown box for Start Hour selection -->
+ <mat-form-field class="selectHour">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartHour" name="hourFrom" placeholder="Select Hour">
+ <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+
+ <!-- Dropdown box for Start Minute selection -->
+ <mat-form-field class="selectMinute">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedStartMinute" name="minuteFrom" placeholder="Select Minute">
+ <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ </div>
+
+ <!-- Dropdown Filter and TextBox for Service Name -->
+ <div class="container-home">
+ <mat-form-field class="selectFilter">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSN" name="sel" placeholder="Select Filter">
+ <mat-option *ngFor="let option of options" [value]="option.value">{{option.name}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ <mat-form-field class="valueInput">
+ <input matInput #searchValueSN type="text" [(ngModel)]="searchData.serviceInstanceName" placeholder="Service Name">
+ </mat-form-field>
+
+ <!-- Angular End Date Picker -->
+ <mat-form-field class="endDate">
+ <input matInput #endDate [matDatepicker]="endpicker" [(ngModel)]="searchData.endDate" placeholder="Choose an end date">
+ <mat-datepicker-toggle matSuffix [for]="endpicker"></mat-datepicker-toggle>
+ <mat-datepicker #endpicker></mat-datepicker>
+ </mat-form-field>
+
+ <!-- Dropdown box for End Hour selection -->
+ <mat-form-field class="selectHour">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndHour" name="hourTo" placeholder="Select Hour">
+ <mat-option *ngFor="let option of hourOptions" [value]="option">{{option}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+
+ <!-- Dropdown box for End Minute selection -->
+ <mat-form-field class="selectMinute">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedEndMinute" name="minuteTo" placeholder="Select Minute">
+ <mat-option *ngFor="let option of minuteOptions" [value]="option">{{option}}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ </div>
+
+ <!-- Dropdown Filter for Status -->
+ <div class="container-home">
+ <mat-form-field class="selectFilter">
+ <mat-select class="formatBox" [(ngModel)]="searchData.selectedValueSTATUS" name="sel" placeholder="Status">
+ <mat-option *ngFor="let statusOption of statusOptions" [value]="statusOption.value">{{ statusOption.name }}</mat-option>
+ </mat-select>
+ </mat-form-field>
+ </div>
+ <br />
+
+ <!-- Button to call makeCall() function to commence search based on parameters -->
+ <button (click)="makeCall()" class="fa fa-search"></button>
+ </div>
+
+ <br />
+
+ <!-- Table to display selected fields if data present -->
+ <div class="example-container mat-elevation-z8">
+ <mat-tab-group class="tab-group">
+ <mat-tab label="Service Instances">
+ <mat-table [dataSource]="processData">
+ <ng-container matColumnDef="requestId">
+ <mat-header-cell *matHeaderCellDef> Request Id </mat-header-cell>
+ <mat-cell *matCellDef="let process"><a routerLink="" (click)="getProcessIsntanceId(process.requestId)">{{ process.requestId }}</a></mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="serviceInstanceId">
+ <mat-header-cell *matHeaderCellDef> Instance Id </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ process.serviceInstanceId }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="serviceIstanceName">
+ <mat-header-cell *matHeaderCellDef> Instance Name </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ process.serviceIstanceName }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="networkId">
+ <mat-header-cell *matHeaderCellDef> Network Id </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ process.networkId }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="requestStatus">
+ <mat-header-cell *matHeaderCellDef> Request Status </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ process.requestStatus }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="serviceType">
+ <mat-header-cell *matHeaderCellDef> Service Type </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ process.serviceType }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="startTime">
+ <mat-header-cell *matHeaderCellDef> Start Time </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ (process.startTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell>
+ </ng-container>
+ <ng-container matColumnDef="endTime">
+ <mat-header-cell *matHeaderCellDef> End Time </mat-header-cell>
+ <mat-cell *matCellDef="let process"> {{ (process.endTime | date:'yyyy-MM-dd HH:mm:sss Z') }} </mat-cell>
+ </ng-container>
+ <mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
+ <mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row>
+ </mat-table>
+ </mat-tab>
+
+ <mat-tab label="Service Statistics">
+ <div id="servStats">
+ <table class="statsTable">
+ <tbody>
+ <tr>
+ <td>Total: {{ totalVal }}</td>
+ <td></td>
+ </tr>
+ <tr>
+ <td>Complete: {{ completeVal }}</td>
+ <td> {{ percentageComplete }}%</td>
+ </tr>
+ <tr>
+ <td>Failed: {{ failedVal }}</td>
+ <td> {{ percentageFailed }}%</td>
+ </tr>
+ <tr>
+ <td>In Progress: {{ inProgressVal }}</td>
+ <td> {{ percentageInProg }}%</td>
+ </tr>
+ <tr>
+ <td>Pending: {{ pendingVal }}</td>
+ <td> {{ percentagePending }}%</td>
+ </tr>
+ <tr>
+ <td>Unlocked: {{ unlockedVal }}</td>
+ <td> {{ percentageUnlocked }}%</td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </mat-tab>
+ </mat-tab-group>
+ </div>
+</div>
+
+<ngx-spinner bdColor="rgba(51, 51, 51, 0.8)" size="large" color="#00285f" type="ball-spin-clockwise-fade-rotating"></ngx-spinner>
+<router-outlet></router-outlet>
export const environment = {
production: false,
- soMonitoringBackendURL: 'http://so-monitoring:9091/so/monitoring/'
+ soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/'
};