Merge "Sonar:Critical"
authorSteve Smokowski <ss835w@att.com>
Thu, 17 Jan 2019 17:42:09 +0000 (17:42 +0000)
committerGerrit Code Review <gerrit@onap.org>
Thu, 17 Jan 2019 17:42:09 +0000 (17:42 +0000)
58 files changed:
adapters/mso-adapter-utils/src/test/java/org/onap/so/openstack/utils/MsoTenantUtilsFactoryTest.java
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/ReplaceVnfInfra.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/UpdateVnfInfra.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfCmBase.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfConfigUpdate.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/VnfInPlaceUpdate.groovy
common/src/main/java/org/onap/so/client/aai/AAIRestClientI.java
common/src/main/java/org/onap/so/client/aai/AAIRestClientImpl.java
common/src/main/java/org/onap/so/client/aai/AAIUpdator.java
common/src/main/java/org/onap/so/client/aai/AAIUpdatorImpl.java
common/src/test/java/org/onap/so/client/aai/AAIUpdatorImplTest.java
common/src/test/java/org/onap/so/client/aai/AAIUpdatorTest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/GlobalHealthcheckHandler.java
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ActivityInstance.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ActivityInstance.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessDefinition.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessDefinition.java with 95% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessInstance.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessInstance.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/ProcessInstanceVariable.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/ProcessInstanceVariable.java with 95% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/camunda/model/SoActiveInfraRequests.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/camunda/model/SoActiveInfraRequests.java with 98% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/camunda/CamundaConfiguration.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/camunda/CamundaConfiguration.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/camunda/CamundaRestUrlProvider.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/camunda/CamundaRestUrlProvider.java with 98% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/database/DatabaseConfiguration.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/database/DatabaseConfiguration.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/database/DatabaseUrlProvider.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/database/DatabaseUrlProvider.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/BasicAuthorizationHttpRequestInterceptor.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java [new file with mode: 0644]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpClientConnectionConfiguration.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/HttpClientConnectionConfiguration.java with 98% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/HttpServiceProviderConfiguration.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/HttpServiceProviderConfiguration.java with 88% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/RestTemplateConfiguration.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/configuration/rest/RestTemplateConfigration.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProvider.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/db/service/DatabaseServiceProvider.java with 92% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/db/service/DatabaseServiceProviderImpl.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/db/service/DatabaseServiceProviderImpl.java with 87% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/InvalidRestRequestException.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/exception/InvalidRestRequestException.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/exception/RestProcessingException.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/exception/RestProcessingException.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ActivityInstanceDetail.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ActivityInstanceDetail.java with 98% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessDefinitionDetail.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessDefinitionDetail.java with 95% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceDetail.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceDetail.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceIdDetail.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceIdDetail.java with 94% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/ProcessInstanceVariableDetail.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/ProcessInstanceVariableDetail.java with 95% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/SoInfraRequest.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/SoInfraRequest.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/model/SoInfraRequestBuilder.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/model/SoInfraRequestBuilder.java with 99% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProvider.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProvider.java with 81% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/CamundaProcessDataServiceProviderImpl.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderImpl.java with 91% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProvider.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/HttpRestServiceProvider.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/rest/service/HttpRestServiceProviderImpl.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/rest/service/HttpRestServiceProviderImpl.java with 96% similarity]
so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/utils/ObjectEqualsUtils.java [moved from so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/montoring/utils/ObjectEqualsUtils.java with 97% similarity]
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaConfigurationTest.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/CamundaRestUrlProviderTest.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/HttpServiceProviderConfigurationTest.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/PojoClassesTests.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/configuration/database/DatabaseUrlProviderTest.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/db/api/DatabaseServiceProviderTest.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/rest/service/CamundaProcessDataServiceProviderTest.java
so-monitoring/so-monitoring-handler/src/test/java/org/onap/so/montoring/utils/ObjectEqualsUtilsTest.java
so-monitoring/so-monitoring-service/src/main/java/org/onap/so/monitoring/rest/api/SoMonitoringController.java
so-monitoring/so-monitoring-service/src/test/java/org/onap/so/monitoring/rest/api/SoMonitoringControllerTest.java
so-monitoring/so-monitoring-ui/src/main/frontend/src/app/data.service.ts
so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.html
so-monitoring/so-monitoring-ui/src/main/frontend/src/app/details/details.component.ts
so-monitoring/so-monitoring-ui/src/main/frontend/src/app/home/home.component.html
so-monitoring/so-monitoring-ui/src/main/frontend/src/environments/environment.ts

index c3c4735..f2717ab 100644 (file)
@@ -4,12 +4,14 @@
  * ================================================================================
  * 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.
@@ -34,6 +36,7 @@ import org.mockito.Mock;
 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)
@@ -41,6 +44,10 @@ public class MsoTenantUtilsFactoryTest {
 
     @Mock
     private CloudConfig cloudConfig;
+    @Mock
+    private MsoKeystoneUtils msoKeystoneUtils;
+    @Mock
+    private MsoKeystoneV3Utils msoKeystoneV3Utils;
     @InjectMocks
     private MsoTenantUtilsFactory msoTenantUtilsFactory;
 
@@ -71,4 +78,29 @@ public class MsoTenantUtilsFactoryTest {
         // 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);
+    }
 }
index 3a20992..671796f 100644 (file)
@@ -431,17 +431,16 @@ public class ReplaceVnfInfra extends VnfCmBase {
                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)
@@ -451,7 +450,6 @@ public class ReplaceVnfInfra extends VnfCmBase {
                        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())
                }
        }
        
index 8c1df9b..f8d73ce 100644 (file)
@@ -411,17 +411,16 @@ public class UpdateVnfInfra extends VnfCmBase {
                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)
@@ -431,7 +430,6 @@ public class UpdateVnfInfra extends VnfCmBase {
                        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())
                }
        }
        
index ae89fa5..4237a8d 100644 (file)
@@ -401,17 +401,16 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
                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)
@@ -421,7 +420,6 @@ public abstract class VnfCmBase extends AbstractServiceTaskProcessor {
                        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())
                }
        }
        
index 7de3359..89f40ed 100644 (file)
@@ -310,17 +310,16 @@ public class VnfConfigUpdate extends VnfCmBase {
                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)
@@ -330,7 +329,6 @@ public class VnfConfigUpdate extends VnfCmBase {
                        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())
                }
        }
        
index f6788fb..84668a5 100644 (file)
@@ -330,17 +330,16 @@ public class VnfInPlaceUpdate extends VnfCmBase {
                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)
@@ -350,7 +349,6 @@ public class VnfInPlaceUpdate extends VnfCmBase {
                        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())
                }
        }
 
index 52f15c4..785c82b 100644 (file)
@@ -31,7 +31,7 @@ public interface AAIRestClientI {
 
        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);
 
index c11b297..1c02409 100644 (file)
@@ -65,7 +65,7 @@ public class AAIRestClientImpl implements AAIRestClientI {
     }
 
     @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()
index 8921e4b..f7c9fe8 100644 (file)
 
 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;
 
 }
index a971fde..2697e4a 100644 (file)
@@ -23,7 +23,6 @@ package org.onap.so.client.aai;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-
 public class AAIUpdatorImpl implements AAIUpdator {
        
        @Autowired
@@ -39,13 +38,13 @@ public class AAIUpdatorImpl implements AAIUpdator {
        }
 
        @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);
        }
 
 }
index 7ba92a1..fdfe41f 100644 (file)
@@ -41,13 +41,13 @@ public class AAIUpdatorImplTest {
 
     @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");
     }
 
 }
index 8989d6d..3fc9776 100644 (file)
@@ -36,7 +36,6 @@ public class AAIUpdatorTest {
        @Mock
        protected AAIRestClientI client;
        String vnfName = "testVnf";
-       String uuid = "UUID";
        AAIUpdatorImpl updator;
        
        @Before
@@ -47,15 +46,15 @@ public class AAIUpdatorTest {
 
        @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
index 70603e5..862e9a6 100644 (file)
@@ -178,7 +178,7 @@ public class GlobalHealthcheckHandler {
                return processResponseFromSubsystem(result,subsystem);
                
        }catch(Exception ex){
-               msoLogger.error(ex.getMessage());
+                       msoLogger.error("Exception occured in GlobalHealthcheckHandler.querySubsystemHealth() "+ ex);
                return HealthcheckStatus.DOWN.toString();
        }
     }
@@ -17,9 +17,9 @@
  * 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;
@@ -17,9 +17,9 @@
  * 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;
@@ -17,9 +17,9 @@
  * 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;
@@ -17,9 +17,9 @@
  * 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;
 
@@ -17,9 +17,9 @@
  * 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;
diff --git a/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java b/so-monitoring/so-monitoring-handler/src/main/java/org/onap/so/monitoring/configuration/rest/CorsConfigurer.java
new file mode 100644 (file)
index 0000000..557e2a6
--- /dev/null
@@ -0,0 +1,52 @@
+/*-
+ * ============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 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;
@@ -18,7 +18,7 @@
  * ============LICENSE_END=========================================================
  */
  
-package org.onap.so.montoring.configuration.rest;
+package org.onap.so.monitoring.configuration.rest;
 
 import java.util.concurrent.TimeUnit;
 
@@ -37,7 +37,7 @@ import org.springframework.web.client.RestTemplate;
  * @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;
@@ -17,9 +17,9 @@
  * 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
@@ -17,9 +17,9 @@
  * 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
@@ -17,9 +17,9 @@
  * 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
@@ -17,9 +17,9 @@
  * 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 {
 
@@ -17,9 +17,9 @@
  * 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.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 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;
index de891dd..fb56d84 100644 (file)
  * 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;
 
 
 /**
index 5fa9b44..3cd8a33 100644 (file)
  * 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
index 13a2f98..1b3e168 100644 (file)
  * 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;
 
 /**
index 93dfa79..f51d4c6 100644 (file)
@@ -17,7 +17,7 @@
  * 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;
 
@@ -46,14 +46,14 @@ public class PojoClassesTests {
 
     @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 {
index d9d2609..d820e94 100644 (file)
@@ -17,7 +17,7 @@
  * 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;
 
index 3bb7b28..8c06426 100644 (file)
@@ -17,7 +17,7 @@
  * 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;
@@ -33,12 +33,12 @@ import java.util.Map;
 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;
 
index 351c476..c3930df 100644 (file)
@@ -17,7 +17,7 @@
  * 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;
@@ -29,15 +29,15 @@ import java.util.List;
 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;
 
index b1ad4ea..dd363ab 100644 (file)
@@ -17,7 +17,7 @@
  * 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;
index de2263b..155b4e6 100644 (file)
@@ -32,16 +32,16 @@ import javax.ws.rs.core.MediaType;
 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;
 
index 13953b0..ca2a88d 100644 (file)
@@ -22,7 +22,7 @@ package org.onap.so.monitoring.rest.api;
 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;
@@ -41,12 +41,12 @@ import javax.ws.rs.core.Response.Status;
 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;
index 7967390..2e8f423 100644 (file)
@@ -30,6 +30,7 @@ import { environment } from '../environments/environment';
 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
@@ -59,12 +60,12 @@ export class DataService {
   }\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
index 45301c7..a98095c 100644 (file)
-<!--\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>
index 4c19ba1..97bbbda 100644 (file)
@@ -43,7 +43,6 @@ import { NgxSpinnerService } from 'ngx-spinner';
 })\r
 \r
 export class DetailsComponent implements OnInit {\r
-\r
   bpmnViewer: any;\r
 \r
   processInstanceID: string;\r
@@ -67,8 +66,8 @@ export class DetailsComponent implements OnInit {
   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
@@ -90,7 +89,7 @@ export class DetailsComponent implements OnInit {
       });\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
@@ -139,7 +138,20 @@ export class DetailsComponent implements OnInit {
   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
@@ -160,4 +172,5 @@ export class DetailsComponent implements OnInit {
         this.getVarInst(this.processInstanceID);\r
       });\r
   }\r
+\r
 }\r
index 2b580e2..e4556ca 100644 (file)
-<!--\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>
index 003abf9..f0c63fe 100644 (file)
@@ -24,5 +24,5 @@ SPDX-License-Identifier: Apache-2.0
 export const environment = {
   production: false,
 
-  soMonitoringBackendURL: 'http://so-monitoring:9091/so/monitoring/'
+  soMonitoringBackendURL: 'http://so-monitoring:30224/so/monitoring/'
 };