summaryrefslogtreecommitdiffstats
path: root/vid-app-common/src/main
diff options
context:
space:
mode:
authorOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
committerOfir Sonsino <os0695@att.com>2018-01-31 17:19:00 +0200
commit1cfb08779ea0e00be69e072a940b3063e049fe6b (patch)
tree6602a900387c8393ed0dcd81c0539381632903c6 /vid-app-common/src/main
parent2f20b001b9243e0f8b44aecc768ec265fd538732 (diff)
org.onap migration
Change-Id: I52f0b2851f2c765752b6d21f49b32136d7d72a3d Issue-ID: VID-86 Signed-off-by: Ofir Sonsino <os0695@att.com>
Diffstat (limited to 'vid-app-common/src/main')
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/RelatedTo.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java)5
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClient.java)201
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java58
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/AaiGetVnfResponse.java)15
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java34
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java107
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java14
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/Services.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java)6
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java)8
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java)8
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java7
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java (renamed from vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java (renamed from vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java30
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java42
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java77
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java)11
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java45
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java29
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java72
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java61
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java84
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java28
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java36
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java28
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java51
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java49
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java21
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java28
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java)5
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java)16
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java)11
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java)10
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java26
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java)25
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java)14
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java)6
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java (renamed from vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java)136
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java (renamed from vid-app-common/src/main/java/org/openecomp/aai/util/AAIRestInterface.java)729
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java (renamed from vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java)146
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java (renamed from vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java)280
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java (renamed from vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java)198
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java (renamed from vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java)156
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java)116
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java)258
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java)628
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java)858
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java)5
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java)705
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java)350
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java)280
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java)398
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java)270
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java)96
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java)336
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java)234
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java)314
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java)240
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java)106
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java)202
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java)248
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java)202
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java)248
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java)922
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java)332
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java)145
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java)744
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParser.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParser.java)10
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java)53
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java)170
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java)947
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java15
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java13
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java31
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java27
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java)16
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java28
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java24
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java)5
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java16
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java)6
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java67
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java36
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java23
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java31
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java15
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java44
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java)2
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java)134
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java)286
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java)1702
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java193
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java40
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java)388
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java115
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java135
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/MsoConfig.java)17
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/MsoController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java)1425
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java354
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java)30
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java)254
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java31
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/VidController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java)268
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java)149
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java)29
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java94
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java48
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java)180
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java)218
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java)1452
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java)112
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java)224
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java)90
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java12
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java)138
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java85
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java120
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java139
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java)186
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java)161
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java39
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java24
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java)86
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java32
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/Network.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Network.java)124
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewNode.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewService.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java)39
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java)4
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/Node.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Node.java)623
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java77
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java30
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java42
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/Resource.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java)56
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/Result.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Result.java)116
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/Service.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Service.java)559
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java139
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java)591
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java46
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java)2
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/VNF.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java)330
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java105
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java)2
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/VfModule.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java)616
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java83
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java)392
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/model/Workflow.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java99
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java800
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java)28
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java)224
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java)236
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java60
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java15
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java)251
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/RestMsoImplementation.java)282
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java131
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java33
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java29
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java)246
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java)184
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java120
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java)250
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java)250
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java)286
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java)467
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java)274
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RestInterface.java)33
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java)13
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java)27
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java)8
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java)2
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java)248
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java)2
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java)186
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/roles/EcompRole.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/roles/EcompRole.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/roles/Role.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java)6
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java138
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java)18
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerProperties.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerProperties.java)11
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java)26
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java)2
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceIfc.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceIfc.java)12
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/AaiService.java63
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java435
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java18
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java144
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java32
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java303
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/CsvService.java15
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java250
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java164
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java5
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/VidService.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/services/VidService.java)8
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java)40
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java (renamed from vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java)4
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java31
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/utils/Logging.java105
-rw-r--r--vid-app-common/src/main/java/org/onap/vid/utils/Streams.java47
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java33
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java21
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java9
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java44
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java87
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java71
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java244
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java107
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java21
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java416
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java85
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java216
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java71
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java352
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java92
-rwxr-xr-xvid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java68
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java67
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java64
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java11
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java10
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java10
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java71
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java5
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java39
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java38
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java57
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java42
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java100
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java106
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java34
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java101
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java14
-rw-r--r--vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java109
-rw-r--r--vid-app-common/src/main/resources/2f80c596.zipbin0 -> 86923 bytes
-rw-r--r--vid-app-common/src/main/resources/aai_config_instance_view_edit.json81
-rw-r--r--vid-app-common/src/main/resources/aai_get_node_template_instances.json101
-rw-r--r--vid-app-common/src/main/resources/adiod.zipbin0 -> 81489 bytes
-rw-r--r--vid-app-common/src/main/resources/csar317927061915233480.zipbin0 -> 63368 bytes
-rw-r--r--vid-app-common/src/main/resources/generateRoleScript.sh3
-rwxr-xr-xvid-app-common/src/main/resources/json/mso/modelInfo1
-rwxr-xr-xvid-app-common/src/main/resources/json/mso/requestStatus9
-rw-r--r--vid-app-common/src/main/resources/owning-entity-properties.JSON17
-rw-r--r--vid-app-common/src/main/resources/pnf.zip (renamed from vid-app-common/src/main/resources/pnf.csar)bin33299 -> 33299 bytes
-rw-r--r--vid-app-common/src/main/resources/scripts/category_parameter.sh64
-rw-r--r--vid-app-common/src/main/resources/scripts/update_category_option_name.sh34
-rw-r--r--vid-app-common/src/main/resources/scripts/vnf_wf.sh49
-rw-r--r--vid-app-common/src/main/resources/sdcservices.json80
-rw-r--r--vid-app-common/src/main/resources/service-AmpPhSvc-csar.zipbin0 -> 68824 bytes
-rw-r--r--vid-app-common/src/main/resources/service-David-csar.csarbin0 -> 29894 bytes
-rw-r--r--vid-app-common/src/main/resources/service-DemoService1-csar.csarbin0 -> 37635 bytes
-rw-r--r--vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csarbin0 -> 31331 bytes
-rw-r--r--vid-app-common/src/main/resources/test.csv5
-rw-r--r--vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js3
-rw-r--r--vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg16
-rw-r--r--vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg18
-rw-r--r--vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg15
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/attach.svg20
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg7
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/emptyData.svg31
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg17
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/refresh.svg19
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/search.svg16
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/sort_down.svg14
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/sort_up.svg14
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/sprite.pngbin0 -> 83746 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/images/v.svg14
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js90
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js171
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js1
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json1
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js15
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js78
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js438
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js83
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js342
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js29
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js892
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js75
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js (renamed from vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js)271
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js46
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js237
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js138
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js102
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js17
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js43
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig507
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js2
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js11
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoClientFactory.java)27
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html2
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js33
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css15
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html15
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js33
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css3
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html12
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js58
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css109
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html26
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js29
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css16
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html14
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html2
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html2
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css6
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html48
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js224
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css130
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html54
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js455
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css145
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html101
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js65
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html50
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html4
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css37
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html12
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/webapp/app/vid/scripts/services/OwningEntityService.js (renamed from vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceFactory.java)84
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js213
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js22
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js28
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js1949
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js89
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js (renamed from vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js)1026
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js373
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js43
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js93
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js79
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js464
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm53
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm102
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm4
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm12
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm2
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm62
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html100
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm11
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm4
-rw-r--r--[-rwxr-xr-x]vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm (renamed from vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm)140
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm79
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm6
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm5
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm62
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm5
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm10
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm4
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm108
-rw-r--r--vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm82
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/buttons.css58
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css67
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/change-management.css28
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/common.css115
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt201
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttfbin0 -> 224592 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttfbin0 -> 213292 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttfbin0 -> 222584 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttfbin0 -> 213420 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttfbin0 -> 212896 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttfbin0 -> 222412 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttfbin0 -> 213128 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttfbin0 -> 217360 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttfbin0 -> 221328 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttfbin0 -> 212820 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eotbin5200 -> 6448 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg3
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttfbin5036 -> 6284 bytes
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woffbin5112 -> 6360 bytes
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/styles/instantiate.css8
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css17
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css29
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css196
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/modals.css52
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/networkNode.css271
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css82
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/search.css37
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css18
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/styles/serviceModels.css4
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css154
-rw-r--r--vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css215
-rwxr-xr-xvid-app-common/src/main/webapp/app/vid/styles/vidTree.css4
-rwxr-xr-xvid-app-common/src/main/webapp/test.jsp20
421 files changed, 28065 insertions, 20077 deletions
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java b/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
index 48ca49705..738f62036 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/RelatedTo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/RelatedTo.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid;
+package org.onap.vid;
import com.fasterxml.jackson.annotation.*;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -10,6 +10,7 @@ import java.util.Map;
@JsonPropertyOrder({
"id",
"node-type",
+ "relationship-label",
"url"
})
public class RelatedTo {
@@ -18,6 +19,8 @@ public class RelatedTo {
public String id;
@JsonProperty("node-type")
public String nodeType;
+ @JsonProperty("relationship-label")
+ public String relationshipLabel;
@JsonProperty("url")
public String url;
@JsonIgnore
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java
index 0f07f2066..2b8cf3a0e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClient.java
@@ -1,18 +1,22 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.apache.http.HttpStatus;
+import org.apache.http.client.utils.URIBuilder;
import org.codehaus.jackson.map.ObjectMapper;
-import org.ecomp.aai.model.AaiAICZones.AicZones;
import org.json.simple.JSONArray;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
-import org.openecomp.aai.util.AAIRestInterface;
+import org.onap.vid.aai.util.AAIRestInterface;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.aai.model.ServiceRelationships;
-import org.openecomp.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.SubscriberList;
+import org.onap.vid.aai.model.AaiGetAicZone.AicZones;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.*;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.model.SubscriberList;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.util.UriUtils;
import javax.servlet.ServletContext;
import javax.ws.rs.BadRequestException;
@@ -20,6 +24,8 @@ import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.Response;
import java.io.File;
import java.io.IOException;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -27,8 +33,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.UUID;
-
/**
+
* Created by Oren on 7/4/17.
*/
public class AaiClient implements AaiClientInterface {
@@ -45,7 +51,7 @@ public class AaiClient implements AaiClientInterface {
*/
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiClient.class);
-
+ private final String getServiceModelsResponseBody = "{\"start\" : \"service-design-and-creation/models/\", \"query\" : \"query/serviceModels-byDistributionStatus?distributionStatus=DISTRIBUTION_COMPLETE_OK\"}";
public AaiClient() {
// certiPath = getCertificatesFile().getAbsolutePath();
@@ -66,6 +72,90 @@ public class AaiClient implements AaiClientInterface {
}
@Override
+ public AaiResponse getServicesByOwningEntityId(List<String> owningEntityIds){
+ File certiPath = getCertificatesFile();
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), getUrlFromLIst("business/owning-entities?", "owning-entity-id=", owningEntityIds), false);
+ AaiResponse aaiResponse = proccessAaiResponse(resp, OwningEntityResponse.class, null);
+
+ return aaiResponse;
+ }
+
+ @Override
+ public AaiResponse getServicesByProjectNames(List<String> projectNames){
+ File certiPath = getCertificatesFile();
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), getUrlFromLIst("business/projects?", "project-name=", projectNames), false);
+ AaiResponse aaiResponse = proccessAaiResponse(resp, ProjectResponse.class, null);
+
+ return aaiResponse;
+ }
+
+ @Override
+ public AaiResponse getServiceModelsByDistributionStatus() {
+ File certiPath = getCertificatesFile();
+ Response resp = doAaiPut(certiPath.getAbsolutePath(), "query?format=resource", getServiceModelsResponseBody, false);
+ AaiResponse aaiResponse = proccessAaiResponse(resp, GetServiceModelsByDistributionStatusResponse.class, null);
+
+ return aaiResponse;
+ }
+
+ @Override
+ public AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel) {
+ String certiPath = getCertificatesFile().getAbsolutePath();
+ String siQuery = "/business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + encodePathSegment(serviceType) + "/service-instances?model-version-id=" + modelVersionId + "&model-invariant-id=" + modelInvariantId;
+ String pnfQuery = "query/pnf-fromModel-byRegion?cloudRegionId=" + encodePathSegment(cloudRegion) + "&equipVendor=" + encodePathSegment(equipVendor) + "&equipModel=" + encodePathSegment(equipModel);
+ String payload = "{\"start\":\"" + siQuery + "\",\"query\":\"" + pnfQuery + "\"}";
+ Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
+ return proccessAaiResponse(resp, AaiGetPnfResponse.class, null);
+ }
+
+
+ @Override
+ public AaiResponse<Pnf> getSpecificPnf(String pnfId) {
+ File certiPath = getCertificatesFile();
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), "network/pnfs/pnf/"+pnfId, false);
+ AaiResponse aaiResponse = proccessAaiResponse(resp, Pnf.class, null);
+
+ return aaiResponse;
+ }
+
+ public AaiResponse getServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId) {
+ String certiPath = getCertificatesFile().getAbsolutePath();
+ String getServiceInstancePath = "business/customers/customer/"+globalCustomerId+"/service-subscriptions/service-subscription/"+serviceType+"/service-instances/service-instance/"+serviceInstanceId;
+ Response resp = doAaiGet(certiPath , getServiceInstancePath , false);
+ return proccessAaiResponse(resp, ServiceRelationships.class, null);
+ }
+
+ @Override
+ public AaiResponse getLogicalLink(String link) {
+ String certiPath = getCertificatesFile().getAbsolutePath();
+ Response resp = doAaiGet(certiPath , "network/logical-links/logical-link/" + link , false);
+ return proccessAaiResponse(resp, LogicalLinkResponse.class, null);
+ }
+
+ private String getUrlFromLIst(String url, String paramKey, List<String> params){
+ url.concat(paramKey);
+ int i = 0;
+ for(String param: params){
+ i ++;
+ url = url.concat(paramKey);
+ String encodedParam= param;
+ try {
+ encodedParam= URLEncoder.encode(param, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ String methodName = "getUrlFromList";
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ }
+ url = url.concat(encodedParam);
+ if(i != params.size()){
+ url = url.concat("&");
+ }
+ }
+ return url;
+ }
+
+
+ @Override
public AaiResponse<SubscriberList> getAllSubscribers() {
String certiPath = getCertificatesFile().getAbsolutePath();
String depth = "0";
@@ -81,20 +171,23 @@ public class AaiClient implements AaiClientInterface {
AaiResponse aaiAicZones = proccessAaiResponse(resp, AicZones.class, null);
return aaiAicZones;
}
-
-
- @Override
- public AaiResponse<String> getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId) {
- String certiPath = getCertificatesFile().getAbsolutePath();
- String aicZonePath = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType + "/service-instances/service-instance/" + serviceId;
- Response resp = doAaiGet(certiPath , aicZonePath , false);
- AaiResponse<ServiceRelationships> aaiResponse = proccessAaiResponse(resp , ServiceRelationships.class , null);
- ServiceRelationships serviceRelationships = (ServiceRelationships)aaiResponse.getT();
- String aicZone = serviceRelationships.getRelationshipList().getRelationship().get(0).getRelatedToPropertyList().get(0).getPropertyValue();
- AaiResponse<String> aaiAicZonaForPnfResponse = new AaiResponse(aicZone , null ,HttpStatus.SC_OK);
- return aaiAicZonaForPnfResponse;
- }
-
+
+
+ @Override
+ public AaiResponse<String> getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId) {
+ String certiPath = getCertificatesFile().getAbsolutePath();
+ String aicZonePath = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType + "/service-instances/service-instance/" + serviceId;
+ Response resp = doAaiGet(certiPath , aicZonePath , false);
+ AaiResponse<ServiceRelationships> aaiResponse = proccessAaiResponse(resp , ServiceRelationships.class , null);
+ ServiceRelationships serviceRelationships = (ServiceRelationships)aaiResponse.getT();
+ RelationshipList relationshipList = serviceRelationships.getRelationshipList();
+ Relationship relationship = relationshipList.getRelationship().get(0);
+ RelationshipData relationshipData= relationship.getRelationDataList().get(0);
+ String aicZone = relationshipData.getRelationshipValue();
+ AaiResponse<String> aaiAicZonaForPnfResponse = new AaiResponse(aicZone , null ,HttpStatus.SC_OK);
+ return aaiAicZonaForPnfResponse;
+ }
+
@Override
public AaiResponse getVNFData() {
@@ -108,7 +201,7 @@ public class AaiClient implements AaiClientInterface {
@Override
public Response getVNFData(String globalSubscriberId, String serviceType) {
String certiPath = getCertificatesFile().getAbsolutePath();
- String payload = "{\"start\": [\"business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/"+ serviceType +"/service-instances\"]," +
+ String payload = "{\"start\": [\"business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/"+ encodePathSegment(serviceType) +"/service-instances\"]," +
"\"query\": \"query/vnf-topology-fromServiceInstance\"}";
return doAaiPut(certiPath, "query?format=simple", payload, false);
@@ -117,7 +210,7 @@ public class AaiClient implements AaiClientInterface {
@Override
public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
String certiPath = getCertificatesFile().getAbsolutePath();
- String payload = "{\"start\": [\"/business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/" + serviceType + "/service-instances/service-instance/" + serviceInstanceId + "\"], \"query\": \"query/vnf-topology-fromServiceInstance\"}";
+ String payload = "{\"start\": [\"/business/customers/customer/" + globalSubscriberId + "/service-subscriptions/service-subscription/" + encodePathSegment(serviceType) + "/service-instances/service-instance/" + serviceInstanceId + "\"], \"query\": \"query/vnf-topology-fromServiceInstance\"}";
Response resp = doAaiPut(certiPath, "query?format=simple", payload, false);
return proccessAaiResponse(resp, AaiGetVnfResponse.class, null);
}
@@ -155,19 +248,56 @@ public class AaiClient implements AaiClientInterface {
}
@Override
+ public AaiResponse getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus) {
+ File certiPath = getCertificatesFile();
+ String url = "cloud-infrastructure/operational-environments";
+ URIBuilder urlBuilder = new URIBuilder();
+ if (operationalEnvironmentType != null)
+ urlBuilder.addParameter("operational-environment-type", operationalEnvironmentType);
+ if (operationalEnvironmentStatus != null)
+ urlBuilder.addParameter("operational-environment-status", operationalEnvironmentStatus);
+ url += urlBuilder.toString();
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
+ AaiResponse<OperationalEnvironmentList> getOperationalEnvironmentsResponse = proccessAaiResponse(resp, OperationalEnvironmentList.class, null);
+ return getOperationalEnvironmentsResponse;
+
+ }
+
+ @Override
public AaiResponse getTenants(String globalCustomerId, String serviceType) {
File certiPath = getCertificatesFile();
String url = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType;
Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
String responseAsString = parseForTenantsByServiceSubscription(resp.readEntity(String.class));
+ if (responseAsString.equals("")){
+ AaiResponse aaiResponse = new AaiResponse<>(null, String.format("{\"statusText\":\" A&AI has no LCP Region & Tenants associated to subscriber '%s' and service type '%s'\"}", globalCustomerId, serviceType), HttpStatus.SC_INTERNAL_SERVER_ERROR);
+ return aaiResponse;
+ }
+ else {
+ AaiResponse<GetTenantsResponse[]> getTenantsResponse = proccessAaiResponse(resp, GetTenantsResponse[].class, responseAsString);
+ return getTenantsResponse;
+ }
- AaiResponse<GetTenantsResponse[]> getTenantsResponse = proccessAaiResponse(resp, GetTenantsResponse[].class, responseAsString);
- return getTenantsResponse;
+ }
+
+ @Override
+ public AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion) {
+
+ String certiPath = getCertificatesFile().getAbsolutePath();
+
+ String siQuery = "/business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + encodePathSegment(serviceType) + "/service-instances?model-version-id=" + modelVersionId + "&model-invariant-id=" + modelInvariantId;
+ String vnfQuery = "query/queryvnfFromModelbyRegion?cloudRegionId=" + encodePathSegment(cloudRegion);
+ String payload1 = "{\"start\":\"" + siQuery + "\",\"query\":\"" + vnfQuery + "\"}";
+
+ Response resp1 = doAaiPut(certiPath, "query?format=simple", payload1, false);
+ AaiResponse aaiResponse1 = proccessAaiResponse(resp1, AaiGetVnfResponse.class, null);
+ logger.debug(EELFLoggerDelegate.debugLogger, "getNodeTemplateInstances AAI's response: {}", aaiResponse1);
+ return aaiResponse1;
}
private AaiResponse proccessAaiResponse(Response resp, Class classType, String responseBody) {
- AaiResponse subscriberDataResponse;
+ AaiResponse subscriberDataResponse = null;
if (resp == null) {
subscriberDataResponse = new AaiResponse<>(null, null, HttpStatus.SC_INTERNAL_SERVER_ERROR);
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Invalid response from AAI");
@@ -177,7 +307,7 @@ public class AaiClient implements AaiClientInterface {
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Invalid response from AAI");
subscriberDataResponse = new AaiResponse<>(null, resp.readEntity(String.class), resp.getStatus());
} else {
- String finalResponse;
+ String finalResponse = null;
try {
if (responseBody != null) {
finalResponse = responseBody;
@@ -187,10 +317,10 @@ public class AaiClient implements AaiClientInterface {
subscriberDataResponse = new AaiResponse<>((new ObjectMapper().readValue(finalResponse, classType)), null, HttpStatus.SC_OK);
- } catch (IOException e) {
+ } catch(Exception e){
subscriberDataResponse = new AaiResponse<>(null, null, HttpStatus.SC_INTERNAL_SERVER_ERROR);
+ logger.error("Failed to parse aai response: \"{}\" to class {}", finalResponse, classType, e);
}
-
}
}
return subscriberDataResponse;
@@ -203,7 +333,7 @@ public class AaiClient implements AaiClientInterface {
}
@SuppressWarnings("all")
- protected Response doAaiGet(String certiPath, String uri, boolean xml) {
+ public Response doAaiGet(String certiPath, String uri, boolean xml) {
String methodName = "doAaiGet";
String transId = UUID.randomUUID().toString();
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
@@ -348,5 +478,12 @@ public class AaiClient implements AaiClientInterface {
}
+ private static String encodePathSegment(String segmentToEncode) {
+ try {
+ return UriUtils.encodePathSegment(segmentToEncode, "UTF-8");
+ } catch (UnsupportedEncodingException e) {
+ throw new RuntimeException("URI encoding failed unexpectedly", e);
+ }
+ }
} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java
new file mode 100644
index 000000000..5095f48b5
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiClientInterface.java
@@ -0,0 +1,58 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.model.SubscriberList;
+
+import javax.ws.rs.core.Response;
+
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public interface AaiClientInterface {
+
+ AaiResponse<SubscriberList> getAllSubscribers();
+
+ AaiResponse getSubscriberData(String subscriberId);
+
+ AaiResponse getServices();
+
+ AaiResponse getServicesByOwningEntityId(List<String> owningEntityIds);
+
+ AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType);
+
+ AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus);
+
+ AaiResponse getAllAicZones();
+
+ AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
+
+ AaiResponse getVNFData();
+
+ Response getVNFData(String globalSubscriberId, String serviceType);
+
+ AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
+
+ AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion);
+
+ Response getVersionByInvariantId(List<String> modelInvariantId);
+
+ AaiResponse getServicesByProjectNames(List<String> projectNames);
+
+ AaiResponse getServiceModelsByDistributionStatus();
+
+ AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel);
+
+ AaiResponse<Pnf> getSpecificPnf(String pnfId);
+
+ AaiResponse getServiceInstance(String globalCustomerId, String serviceType, String serviceInstanceId);
+
+ AaiResponse getLogicalLink(String link);
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiGetVnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
index 7c9d44b12..14e8e5dcf 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiGetVnfResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiGetVnfResponse.java
@@ -1,6 +1,9 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
-import com.fasterxml.jackson.annotation.*;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.google.common.base.MoreObjects;
+import org.codehaus.jackson.annotate.*;
+import org.onap.vid.aai.model.VnfResult;
import java.util.HashMap;
import java.util.List;
@@ -25,4 +28,12 @@ public class AaiGetVnfResponse {
public void setAdditionalProperty(String name, Object value) {
this.additionalProperties.put(name, value);
}
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("results", results)
+ .add("additionalProperties", additionalProperties)
+ .toString();
+ }
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java
new file mode 100644
index 000000000..c4b19b134
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/AaiResponse.java
@@ -0,0 +1,34 @@
+package org.onap.vid.aai;
+
+import com.google.common.base.MoreObjects;
+import org.onap.vid.model.ProxyResponse;
+
+/**
+ * Created by Oren on 7/10/17.
+ */
+public class AaiResponse<T> extends ProxyResponse{
+
+ T t;
+
+ public AaiResponse() {
+ }
+
+ public AaiResponse(T t, String errorMessage, int aaiHttpCode) {
+ this.t = t;
+ this.errorMessage = errorMessage;
+ this.httpCode = aaiHttpCode;
+ }
+
+ public T getT() {
+ return t;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("httpCode", httpCode)
+ .add("errorMessage", errorMessage)
+ .add("t", t)
+ .toString();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java b/vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java
new file mode 100644
index 000000000..10ad4e963
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/OperationalEnvironment.java
@@ -0,0 +1,107 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.aai.model.Relationship;
+import org.onap.vid.aai.model.RelationshipList;
+
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class OperationalEnvironment {
+
+ private String operationalEnvironmentId;
+ private String operationalEnvironmentName;
+ private String operationalEnvironmentType;
+ private String operationalEnvironmentStatus;
+ private String tenantContext;
+ private String workloadContext;
+ private String resourceVersion;
+ private RelationshipList relationshipList;
+
+ public OperationalEnvironment() {
+ }
+
+ public OperationalEnvironment(String operationalEnvironmentId, String operationalEnvironmentName, String operationalEnvironmentType, String operationalEnvironmentStatus, String tenantContext, String workloadContext, String resourceVersion, RelationshipList relationshipList) {
+ this.operationalEnvironmentId = operationalEnvironmentId;
+ this.operationalEnvironmentName = operationalEnvironmentName;
+ this.operationalEnvironmentType = operationalEnvironmentType;
+ this.operationalEnvironmentStatus = operationalEnvironmentStatus;
+ this.tenantContext = tenantContext;
+ this.workloadContext = workloadContext;
+ this.resourceVersion = resourceVersion;
+ this.relationshipList = relationshipList;
+ }
+
+ @JsonProperty("operational-environment-id")
+ public String getOperationalEnvironmentId() {
+ return operationalEnvironmentId;
+ }
+
+ public void setOperationalEnvironmentId(String operationalEnvironmentId) {
+ this.operationalEnvironmentId = operationalEnvironmentId;
+ }
+
+ @JsonProperty("operational-environment-name")
+ public String getOperationalEnvironmentName() {
+ return operationalEnvironmentName;
+ }
+
+ public void setOperationalEnvironmentName(String operationalEnvironmentName) {
+ this.operationalEnvironmentName = operationalEnvironmentName;
+ }
+
+ @JsonProperty("operational-environment-type")
+ public String getOperationalEnvironmentType() {
+ return operationalEnvironmentType;
+ }
+
+ public void setOperationalEnvironmentType(String operationalEnvironmentType) {
+ this.operationalEnvironmentType = operationalEnvironmentType;
+ }
+
+ @JsonProperty("operational-environment-status")
+ public String getOperationalEnvironmentStatus() {
+ return operationalEnvironmentStatus;
+ }
+
+ public void setOperationalEnvironmentStatus(String operationalEnvironmentStatus) {
+ this.operationalEnvironmentStatus = operationalEnvironmentStatus;
+ }
+
+ @JsonProperty("tenant-context")
+ public String getTenantContext() {
+ return tenantContext;
+ }
+
+ public void setTenantContext(String tenantContext) {
+ this.tenantContext = tenantContext;
+ }
+
+ @JsonProperty("workload-context")
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public void setWorkloadContext(String workloadContext) {
+ this.workloadContext = workloadContext;
+ }
+
+ @JsonProperty("resource-version")
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ @JsonProperty("relationship-list")
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
index 45f7947ef..26f4a21e7 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
index 063317e43..c92a47a36 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceInstances.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstances.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java
new file mode 100644
index 000000000..b32a83a13
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceInstancesSearchResults.java
@@ -0,0 +1,14 @@
+package org.onap.vid.aai;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.model.ServiceInstanceSearchResult;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ServiceInstancesSearchResults {
+ @JsonProperty("service-instances")
+ public List<ServiceInstanceSearchResult> serviceInstances;
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
index 6a178d970..5dc9d526b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscription.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscription.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
index eaadba2cc..686dc7d60 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceSubscriptions.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/ServiceSubscriptions.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java b/vid-app-common/src/main/java/org/onap/vid/aai/Services.java
index e8148a92c..fe70de5af 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/Services.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/Services.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
index 53304e933..2dad75fdf 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberAaiResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberAaiResponse.java
@@ -1,7 +1,7 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
-import org.openecomp.vid.model.ProxyResponse;
-import org.openecomp.vid.model.SubscriberList;
+import org.onap.vid.model.ProxyResponse;
+import org.onap.vid.model.SubscriberList;
/**
* Created by Oren on 7/5/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
index efaa47885..1c93d97e2 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberData.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
/**
* Created by Oren on 7/10/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
index c2afee334..2db981999 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberFilteredResults.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberFilteredResults.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
-import org.openecomp.vid.model.ProxyResponse;
-import org.openecomp.vid.model.SubscriberList;
-import org.openecomp.vid.roles.RoleValidator;
+import org.onap.vid.model.ProxyResponse;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
/**
* Created by Oren on 7/5/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
index 75f505f25..0d4b4b7b3 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberListWithFilterData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberListWithFilterData.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
-import org.openecomp.vid.model.Subscriber;
-import org.openecomp.vid.model.SubscriberList;
-import org.openecomp.vid.roles.RoleValidator;
+import org.onap.vid.model.Subscriber;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
import java.util.ArrayList;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
index abd9c0f32..aaaa14455 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/SubscriberWithFilter.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/SubscriberWithFilter.java
@@ -1,7 +1,7 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai;
import org.codehaus.jackson.annotate.JsonProperty;
-import org.openecomp.vid.model.Subscriber;
+import org.onap.vid.model.Subscriber;
/**
* Created by Oren on 7/5/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
index f84c09afa..e6296488e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/exceptions/InvalidAAIResponseException.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/InvalidAAIResponseException.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.exceptions;
+package org.onap.vid.aai.exceptions;
/**
* Created by Oren on 7/4/17.
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java
new file mode 100644
index 000000000..1d838a1c0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/exceptions/RoleParsingException.java
@@ -0,0 +1,7 @@
+package org.onap.vid.aai.exceptions;
+
+/**
+ * Created by Oren on 12/16/17.
+ */
+public class RoleParsingException extends Exception {
+}
diff --git a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
index ee8bcf0c8..c30aaeb8f 100644
--- a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/AicZones.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/AicZones.java
@@ -1,4 +1,4 @@
-package org.ecomp.aai.model.AaiAICZones;
+package org.onap.vid.aai.model.AaiGetAicZone;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
index 00d387c2b..89400f20e 100644
--- a/vid-app-common/src/main/java/org/ecomp/aai/model/AaiAICZones/Zone.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetAicZone/Zone.java
@@ -1,4 +1,4 @@
-package org.ecomp.aai.model.AaiAICZones;
+package org.onap.vid.aai.model.AaiGetAicZone;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java
new file mode 100644
index 000000000..1f31cfaa9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetOperationalEnvironments/OperationalEnvironmentList.java
@@ -0,0 +1,30 @@
+package org.onap.vid.aai.model.AaiGetOperationalEnvironments;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.aai.OperationalEnvironment;
+
+import java.util.List;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class OperationalEnvironmentList {
+
+ @JsonProperty("operational-environment")
+ public List<OperationalEnvironment> getOperationalEnvironment() {
+ return operationalEnvironment;
+ }
+
+ @JsonProperty("operational-environment")
+ public void setOperationalEnvironment(List<OperationalEnvironment> operationalEnvironment) {
+ this.operationalEnvironment = operationalEnvironment;
+ }
+
+ public OperationalEnvironmentList() {
+ }
+
+ public OperationalEnvironmentList(List<OperationalEnvironment> operationalEnvironment) {
+ this.operationalEnvironment = operationalEnvironment;
+ }
+
+ private List<OperationalEnvironment> operationalEnvironment;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java
new file mode 100644
index 000000000..cd8cca8f2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfResponse.java
@@ -0,0 +1,42 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.google.common.base.MoreObjects;
+import org.codehaus.jackson.annotate.JsonAnyGetter;
+import org.codehaus.jackson.annotate.JsonAnySetter;
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.codehaus.jackson.annotate.JsonPropertyOrder;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "results"
+})
+public class AaiGetPnfResponse {
+ @JsonProperty("results")
+ public List<PnfResult> results = null;
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("results", results)
+ .add("additionalProperties", additionalProperties)
+ .toString();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
new file mode 100644
index 000000000..00a731a70
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetPnfs/Pnf.java
@@ -0,0 +1,77 @@
+package org.onap.vid.aai.model.AaiGetPnfs;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.aai.model.AaiRelationResponse;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Pnf extends AaiRelationResponse {
+
+ @JsonProperty("pnf-name")
+ public String pnfName;
+ @JsonProperty("pnf-name2")
+ public String pnfName2;
+ @JsonProperty("pnf-name2-source")
+ public String pnfName2Source;
+ @JsonProperty("pnf-id")
+ public String pnfId;
+ @JsonProperty("equip-type")
+ public String equipType;
+ @JsonProperty("equip-vendor")
+ public String equipVendor;
+ @JsonProperty("equip-model")
+ public String equipModel;
+
+ public String getPnfName() {
+ return pnfName;
+ }
+
+ public void setPnfName(String pnfName) {
+ this.pnfName = pnfName;
+ }
+
+ public String getEquipType() {
+ return equipType;
+ }
+
+ public void setEquipType(String equipType) {
+ this.equipType = equipType;
+ }
+
+ public String getEquipVendor() {
+ return equipVendor;
+ }
+
+ public void setEquipVendor(String equipVendor) {
+ this.equipVendor = equipVendor;
+ }
+
+ public String getPnfName2() {
+ return pnfName2;
+ }
+
+ public void setPnfName2(String pnfName2) {
+ this.pnfName2 = pnfName2;
+ }
+
+ public String getPnfId() {
+ return pnfId;
+ }
+
+ public void setPnfId(String pnfId) {
+ this.pnfId = pnfId;
+ }
+
+ public String getEquipModel() {
+ return equipModel;
+ }
+
+ public void setEquipModel(String equipModel) {
+ this.equipModel = equipModel;
+ }
+
+ public String getPnfName2Source() { return pnfName2Source; }
+
+ public void setPnfName2Source(String pnfName2Source) { this.pnfName2Source = pnfName2Source; }
+}
+
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
index 27c38ce8a..d3dd7d26c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/GetServicesAAIRespone.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model.AaiGetServicesRequestModel;
+package org.onap.vid.aai.model.AaiGetServicesRequestModel;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
index 977e57e67..367287e1d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetServicesRequestModel/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetServicesRequestModel/Service.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model.AaiGetServicesRequestModel;
+package org.onap.vid.aai.model.AaiGetServicesRequestModel;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
index 5e88bf37e..bee92440d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiGetTenatns/GetTenantsResponse.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model.AaiGetTenatns;
+package org.onap.vid.aai.model.AaiGetTenatns;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -21,6 +21,13 @@ public class GetTenantsResponse {
@JsonProperty("is-permitted")
public boolean isPermitted;
+ public GetTenantsResponse() {
+ }
-
+ public GetTenantsResponse(String cloudRegionId, String tenantName, String tenantID, boolean isPermitted) {
+ this.cloudRegionId = cloudRegionId;
+ this.tenantName = tenantName;
+ this.tenantID = tenantID;
+ this.isPermitted = isPermitted;
+ }
} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java
new file mode 100644
index 000000000..7bc2e7a2e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/AaiRelationResponse.java
@@ -0,0 +1,45 @@
+package org.onap.vid.aai.model;
+
+
+
+import org.codehaus.jackson.annotate.JsonIgnore;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class AaiRelationResponse {
+
+ @JsonProperty("resource-version")
+ private String resourceVersion;
+ @JsonProperty("relationship-list")
+ private RelationshipList relationshipList;
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+
+ @JsonProperty("resource-version")
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ @JsonProperty("resource-version")
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ @JsonProperty("relationship-list")
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ @JsonProperty("relationship-list")
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java
new file mode 100644
index 000000000..5a6924dcb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/GetServiceModelsByDistributionStatusResponse.java
@@ -0,0 +1,29 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class GetServiceModelsByDistributionStatusResponse {
+ @JsonProperty("results")
+ private List<Result> results;
+
+
+ @JsonProperty("results")
+ public List<Result> getResults() {
+ return results;
+ }
+
+ @JsonProperty("results")
+ public void setResults(List<Result> results) {
+ this.results = results;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java
new file mode 100644
index 000000000..6625957ec
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/LogicalLinkResponse.java
@@ -0,0 +1,72 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+public class LogicalLinkResponse {
+
+ @JsonProperty("link-name")
+ public String linkName;
+
+ @JsonProperty("in-maint")
+ public Boolean inMaint;
+
+ @JsonProperty("link-type")
+ public String linkType;
+
+ @JsonProperty("resource-version")
+ public String resourceVersion;
+
+ @JsonProperty("purpose")
+ public String purpose;
+
+ @JsonProperty("relationship-list")
+ public RelationshipList relationshipList;
+
+ public String getLinkName() {
+ return linkName;
+ }
+
+ public void setLinkName(String linkName) {
+ this.linkName = linkName;
+ }
+
+ public Boolean getInMaint() {
+ return inMaint;
+ }
+
+ public void setInMaint(Boolean inMaint) {
+ this.inMaint = inMaint;
+ }
+
+ public String getLinkType() {
+ return linkType;
+ }
+
+ public void setLinkType(String linkType) {
+ this.linkType = linkType;
+ }
+
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ public String getPurpose() {
+ return purpose;
+ }
+
+ public void setPurpose(String purpose) {
+ this.purpose = purpose;
+ }
+
+ public RelationshipList getRelationshipList() {
+ return relationshipList;
+ }
+
+ public void setRelationshipList(RelationshipList relationshipList) {
+ this.relationshipList = relationshipList;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java
new file mode 100644
index 000000000..5f422f68a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Model.java
@@ -0,0 +1,61 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Model {
+
+ @JsonProperty("model-invariant-id")
+ private String modelInvariantId;
+ @JsonProperty("model-type")
+ private String modelType;
+ @JsonProperty("resource-version")
+ private String resourceVersion;
+ @JsonProperty("model-vers")
+ private ModelVers modelVers;
+
+ @JsonProperty("model-invariant-id")
+ public String getModelInvariantId() {
+ return modelInvariantId;
+ }
+
+ @JsonProperty("model-invariant-id")
+ public void setModelInvariantId(String modelInvariantId) {
+ this.modelInvariantId = modelInvariantId;
+ }
+
+ @JsonProperty("model-type")
+ public String getModelType() {
+ return modelType;
+ }
+
+ @JsonProperty("model-type")
+ public void setModelType(String modelType) {
+ this.modelType = modelType;
+ }
+
+ @JsonProperty("resource-version")
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ @JsonProperty("resource-version")
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ @JsonProperty("model-vers")
+ public ModelVers getModelVers() {
+ return modelVers;
+ }
+
+ @JsonProperty("model-vers")
+ public void setModelVers(ModelVers modelVers) {
+ this.modelVers = modelVers;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java
new file mode 100644
index 000000000..f02bbacfe
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVer.java
@@ -0,0 +1,84 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ModelVer {
+
+ @JsonProperty("model-version-id")
+ private String modelVersionId;
+ @JsonProperty("model-name")
+ private String modelName;
+ @JsonProperty("model-version")
+ private String modelVersion;
+ @JsonProperty("distribution-status")
+ private String distributionStatus;
+ @JsonProperty("resource-version")
+ private String resourceVersion;
+ @JsonProperty("model-description")
+ private String modelDescription;
+
+
+
+ @JsonProperty("model-version-id")
+ public String getModelVersionId() {
+ return modelVersionId;
+ }
+
+ @JsonProperty("model-version-id")
+ public void setModelVersionId(String modelVersionId) {
+ this.modelVersionId = modelVersionId;
+ }
+
+ @JsonProperty("model-name")
+ public String getModelName() {
+ return modelName;
+ }
+
+ @JsonProperty("model-name")
+ public void setModelName(String modelName) {
+ this.modelName = modelName;
+ }
+
+ @JsonProperty("model-version")
+ public String getModelVersion() {
+ return modelVersion;
+ }
+
+ @JsonProperty("model-version")
+ public void setModelVersion(String modelVersion) {
+ this.modelVersion = modelVersion;
+ }
+
+ @JsonProperty("distribution-status")
+ public String getDistributionStatus() {
+ return distributionStatus;
+ }
+
+ @JsonProperty("distribution-status")
+ public void setDistributionStatus(String distributionStatus) {
+ this.distributionStatus = distributionStatus;
+ }
+
+ @JsonProperty("resource-version")
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ @JsonProperty("resource-version")
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ @JsonProperty("model-description")
+ public String getModelDescription() {
+ return modelDescription;
+ }
+
+ @JsonProperty("model-description")
+ public void setModelDescription(String modelDescription) {
+ this.modelDescription = modelDescription;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java
new file mode 100644
index 000000000..f352158f2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ModelVers.java
@@ -0,0 +1,28 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class ModelVers {
+
+ @JsonProperty("model-ver")
+ private List<ModelVer> modelVer;
+
+ @JsonProperty("model-ver")
+ public List<ModelVer> getModelVer() {
+ return modelVer;
+ }
+
+ @JsonProperty("model-ver")
+ public void setModelVer(List<ModelVer> modelVer) {
+ this.modelVer = modelVer;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java
new file mode 100644
index 000000000..edf5242d6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntity.java
@@ -0,0 +1,36 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class OwningEntity extends AaiRelationResponse {
+ @JsonProperty("owning-entity-id")
+ private String owningEntityId;
+ @JsonProperty("owning-entity-name")
+ private String owningEntityName;
+
+ @JsonProperty("owning-entity-id")
+ public String getOwningEntityId() {
+ return owningEntityId;
+ }
+
+ @JsonProperty("owning-entity-id")
+ public void setOwningEntityId(String owningEntityId) {
+ this.owningEntityId = owningEntityId;
+ }
+
+ @JsonProperty("owning-entity-name")
+ public String getOwningEntityName() {
+ return owningEntityName;
+ }
+
+ @JsonProperty("owning-entity-name")
+ public void setOwningEntityName(String owningEntityName) {
+ this.owningEntityName = owningEntityName;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java
new file mode 100644
index 000000000..3a571ea14
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/OwningEntityResponse.java
@@ -0,0 +1,28 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class OwningEntityResponse {
+
+ @JsonProperty("owning-entity")
+ private List<OwningEntity> owningEntity;
+
+
+ @JsonProperty("owning-entity")
+ public List<OwningEntity> getOwningEntity() {
+ return owningEntity;
+ }
+
+ @JsonProperty("owning-entity")
+ public void setOwningEntity(List<OwningEntity> owningEntity) {
+ this.owningEntity = owningEntity;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java
new file mode 100644
index 000000000..3481d263e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfProperties.java
@@ -0,0 +1,51 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
+@JsonPropertyOrder({
+ "pnf-name",
+ "equip-type",
+ "equip-vendor",
+ "equip-model",
+ "in-maint",
+ "resource-version"
+})
+public class PnfProperties {
+
+ @JsonProperty("pnf-name")
+ public String pnfName;
+ @JsonProperty("equip-type")
+ public String equipType;
+ @JsonProperty("equip-vendor")
+ public String equipVendor;
+ @JsonProperty("equip-model")
+ public String equipModel;
+ @JsonProperty("in-maint")
+ public Boolean inMaint;
+ @JsonProperty("resource-version")
+ public String resourceVersion;
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
new file mode 100644
index 000000000..a727d8f3c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/PnfResult.java
@@ -0,0 +1,49 @@
+package org.onap.vid.aai.model;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.codehaus.jackson.annotate.JsonProperty;
+import org.onap.vid.RelatedTo;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "id",
+ "node-type",
+ "url",
+ "properties",
+ "related-to"
+})
+public class PnfResult {
+
+ @JsonProperty("id")
+ public String id;
+ @JsonProperty("node-type")
+ public String nodeType;
+ @JsonProperty("url")
+ public String url;
+ @JsonProperty("properties")
+ public PnfProperties properties;
+ @JsonProperty("related-to")
+ public List<RelatedTo> relatedTo;
+
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java
new file mode 100644
index 000000000..5931bb97a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Project.java
@@ -0,0 +1,21 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class Project extends AaiRelationResponse {
+
+ @JsonProperty("project-name")
+ private String projectName;
+
+ @JsonProperty("project-name")
+ public String getProjectName() { return projectName; }
+
+ @JsonProperty("project-name")
+ public void setProjectName(String projectName) { this.projectName = projectName; }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java
new file mode 100644
index 000000000..0ca35b0a9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ProjectResponse.java
@@ -0,0 +1,28 @@
+package org.onap.vid.aai.model;
+
+
+import org.codehaus.jackson.annotate.JsonProperty;
+
+import java.util.List;
+
+/**
+ * Created by moriya1 on 08/10/2017.
+ */
+public class ProjectResponse {
+
+ @JsonProperty("project")
+ private List<Project> project;
+
+
+ @JsonProperty("project")
+ public List<Project> getProject() {
+ return project;
+ }
+
+ @JsonProperty("project")
+ public void setProject(List<Project> project) {
+ this.project = project;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
index c9f28ed69..38003aec2 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelatedToProperty.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelatedToProperty.java
@@ -1,9 +1,10 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
+
import org.codehaus.jackson.annotate.JsonProperty;
public class RelatedToProperty {
-
+
public String getPropertyKey() {
return propertyKey;
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
index 796094192..c80d5b6be 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Relationship.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Relationship.java
@@ -1,8 +1,11 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
import java.util.List;
-import org.codehaus.jackson.annotate.JsonProperty;
+
+
public class Relationship {
@@ -11,6 +14,9 @@ public class Relationship {
@JsonProperty("related-link")
public String relatedLink;
+
+ @JsonProperty("relationship-label")
+ public String relationshipLabel;
@JsonProperty("relationship-data")
public List<RelationshipData> relationshipData;
@@ -51,5 +57,11 @@ public class Relationship {
this.relatedToProperty = relatedToPropertyList;
}
+ public String getRelationshipLabel() {
+ return relationshipLabel;
+ }
+ public void setRelationshipLabel(String relationshipLabel) {
+ this.relationshipLabel = relationshipLabel;
+ }
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
index 21af2f5d6..5d2d4091d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipData.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipData.java
@@ -1,21 +1,22 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
+
import org.codehaus.jackson.annotate.JsonProperty;
public class RelationshipData {
-
+ @JsonProperty("relationship-key")
public String getRelationshipKey() {
return relationshipKey;
}
-
+ @JsonProperty("relationship-key")
public void setRelationshipKey(String relationshipKey) {
this.relationshipKey = relationshipKey;
}
-
+ @JsonProperty("relationship-value")
public String getRelationshipValue() {
return relationshipValue;
}
-
+ @JsonProperty("relationship-value")
public void setRelationshipValue(String relationshipValue) {
this.relationshipValue = relationshipValue;
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
index cdb7af46b..43194fc7c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/RelationshipList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/RelationshipList.java
@@ -1,16 +1,18 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonProperty;
import java.util.List;
-import org.codehaus.jackson.annotate.JsonProperty;
public class RelationshipList {
-
+ @JsonProperty("relationship")
public List<Relationship> getRelationship() {
return relationship;
}
-
+
+ @JsonProperty("relationship")
public void setRelationship(List<Relationship> relationship) {
this.relationship = relationship;
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java
new file mode 100644
index 000000000..1eb46be75
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Result.java
@@ -0,0 +1,26 @@
+package org.onap.vid.aai.model;
+
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
+import org.codehaus.jackson.annotate.JsonProperty;
+
+/**
+ * Created by moriya1 on 15/10/2017.
+ */
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class Result {
+ @JsonProperty("model")
+ private Model model;
+
+ @JsonProperty("model")
+ public Model getModel() {
+ return model;
+ }
+
+ @JsonProperty("model")
+ public void setModel(Model model) {
+ this.model = model;
+ }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
index 9fe4c06bc..381f9bc25 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
index 163ed0458..0fced4c57 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceInstances.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceInstances.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
index 113f113d3..a76bcf8a1 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/ServiceProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceProperties.java
@@ -1,12 +1,14 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai.model;
import com.fasterxml.jackson.annotation.*;
+import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import java.util.HashMap;
import java.util.Map;
@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonIgnoreProperties(ignoreUnknown = true)
@JsonPropertyOrder({
"service-instance-id",
"service-instance-name",
@@ -33,46 +35,67 @@ import java.util.Map;
public class ServiceProperties {
@JsonProperty("service-instance-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("service-instance-id")
public String serviceInstanceId;
@JsonProperty("service-instance-name")
+ @com.fasterxml.jackson.annotation.JsonProperty("service-instance-name")
public String serviceInstanceName;
@JsonProperty("model-invariant-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("model-invariant-id")
public String modelInvariantId;
@JsonProperty("model-version-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("model-version-id")
public String modelVersionId;
@JsonProperty("resource-version")
+ @com.fasterxml.jackson.annotation.JsonProperty("resource-version")
public String resourceVersion;
@JsonProperty("orchestration-status")
+ @com.fasterxml.jackson.annotation.JsonProperty("orchestration-status")
public String orchestrationStatus;
@JsonProperty("global-customer-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("global-customer-id")
public String globalCustomerId;
@JsonProperty("subscriber-name")
+ @com.fasterxml.jackson.annotation.JsonProperty("subscriber-name")
public String subscriberName;
@JsonProperty("subscriber-type")
+ @com.fasterxml.jackson.annotation.JsonProperty("subscriber-type")
public String subscriberType;
@JsonProperty("vnf-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("vnf-id")
public String vnfId;
@JsonProperty("vnf-name")
+ @com.fasterxml.jackson.annotation.JsonProperty("vnf-name")
public String vnfName;
@JsonProperty("vnf-type")
+ @com.fasterxml.jackson.annotation.JsonProperty("vnf-type")
public String vnfType;
@JsonProperty("service-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("service-id")
public String serviceId;
@JsonProperty("prov-status")
+ @com.fasterxml.jackson.annotation.JsonProperty("prov-status")
public String provStatus;
@JsonProperty("in-maint")
+ @com.fasterxml.jackson.annotation.JsonProperty("in-maint")
public Boolean inMaint;
@JsonProperty("is-closed-loop-disabled")
+ @com.fasterxml.jackson.annotation.JsonProperty("is-closed-loop-disabled")
public Boolean isClosedLoopDisabled;
@JsonProperty("model-customization-id")
+ @com.fasterxml.jackson.annotation.JsonProperty("model-customization-id")
public String modelCustomizationId;
@JsonProperty("nf-type")
+ @com.fasterxml.jackson.annotation.JsonProperty("nf-type")
public String nfType;
@JsonProperty("nf-function")
+ @com.fasterxml.jackson.annotation.JsonProperty("nf-function")
public String nfFunction;
@JsonProperty("nf-role")
+ @com.fasterxml.jackson.annotation.JsonProperty("nf-role")
public String nfRole;
@JsonProperty("nf-naming-code")
+ @com.fasterxml.jackson.annotation.JsonProperty("nf-naming-code")
public String nfNamingCode;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
index 9bedd8545..b8abc8494 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceRelationships.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceRelationships.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
import org.codehaus.jackson.annotate.JsonProperty;
@@ -10,6 +10,18 @@ public class ServiceRelationships {
@JsonProperty("service-instance-name")
public String serviceInstanceName;
+ @JsonProperty("service-type")
+ public String serviceType;
+
+ @JsonProperty("service-role")
+ public String serviceRole;
+
+ @JsonProperty("environment-context")
+ public String environmentContext;
+
+ @JsonProperty("workload-context")
+ public String workloadContext;
+
@JsonProperty("model-invariant-id")
public String modelInvariantId;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
index 02ddfd178..91582e816 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/ServiceSubscription.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/ServiceSubscription.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
index 6e7b89070..3ba4b22d0 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/model/Services.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/Services.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.aai.model;
+package org.onap.vid.aai.model;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
index b8294e519..e4f22849d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/VnfResult.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/model/VnfResult.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.aai;
+package org.onap.vid.aai.model;
import com.fasterxml.jackson.annotation.*;
import org.codehaus.jackson.annotate.JsonProperty;
-import org.openecomp.vid.RelatedTo;
+import org.onap.vid.RelatedTo;
import java.util.HashMap;
import java.util.List;
@@ -21,6 +21,7 @@ public class VnfResult {
@JsonProperty("id")
public String id;
+ @com.fasterxml.jackson.annotation.JsonProperty("node-type")
@JsonProperty("node-type")
public String nodeType;
@JsonProperty("url")
@@ -28,6 +29,7 @@ public class VnfResult {
@JsonProperty("properties")
public ServiceProperties properties;
@JsonProperty("related-to")
+ @com.fasterxml.jackson.annotation.JsonProperty("related-to")
public List<RelatedTo> relatedTo = null;
@JsonIgnore
private Map<String, Object> additionalProperties = new HashMap<String, Object>();
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
index 9716ba827..254584ca1 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIProperties.java
@@ -1,68 +1,68 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-/**
- * The Class AAIProperties.
- */
-public class AAIProperties extends SystemProperties {
-
- /** The Constant AAI_SERVER_URL_BASE. */
- //VID Specific
- public static final String AAI_SERVER_URL_BASE = "aai.server.url.base";
-
- /** The Constant AAI_SERVER_URL. */
- public static final String AAI_SERVER_URL = "aai.server.url";
-
- /** The Constant AAI_OLDSERVER_URL_BASE. */
- public static final String AAI_OLDSERVER_URL_BASE = "aai.oldserver.url.base";
-
- /** The Constant AAI_OLDSERVER_URL. */
- public static final String AAI_OLDSERVER_URL = "aai.oldserver.url";
-
- /** The Constant AAI_TRUSTSTORE_FILENAME. */
- public static final String AAI_TRUSTSTORE_FILENAME = "aai.truststore.filename";
-
- /** The Constant AAI_TRUSTSTORE_PASSWD_X. */
- public static final String AAI_TRUSTSTORE_PASSWD_X = "aai.truststore.passwd.x";
-
- /** The Constant AAI_KEYSTORE_FILENAME. */
- public static final String AAI_KEYSTORE_FILENAME = "aai.keystore.filename";
-
- /** The Constant AAI_KEYSTORE_PASSWD_X. */
- public static final String AAI_KEYSTORE_PASSWD_X = "aai.keystore.passwd.x";
-
- /** The Constant AAI_VID_USERNAME. */
- public static final String AAI_VID_USERNAME = "aai.vid.username";
-
- /** The Constant AAI_VID_PASSWD_X. */
- public static final String AAI_VID_PASSWD_X = "aai.vid.passwd.x";
-
- /** The Constant FILESEPARTOR. */
- public static final String FILESEPARTOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
-
- /** The Constant AAI_USE_CLIENT_CERT */
- public static final String AAI_USE_CLIENT_CERT = "aai.use.client.cert";
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+/**
+ * The Class AAIProperties.
+ */
+public class AAIProperties extends SystemProperties {
+
+ /** The Constant AAI_SERVER_URL_BASE. */
+ //VID Specific
+ public static final String AAI_SERVER_URL_BASE = "aai.server.url.base";
+
+ /** The Constant AAI_SERVER_URL. */
+ public static final String AAI_SERVER_URL = "aai.server.url";
+
+ /** The Constant AAI_OLDSERVER_URL_BASE. */
+ public static final String AAI_OLDSERVER_URL_BASE = "aai.oldserver.url.base";
+
+ /** The Constant AAI_OLDSERVER_URL. */
+ public static final String AAI_OLDSERVER_URL = "aai.oldserver.url";
+
+ /** The Constant AAI_TRUSTSTORE_FILENAME. */
+ public static final String AAI_TRUSTSTORE_FILENAME = "aai.truststore.filename";
+
+ /** The Constant AAI_TRUSTSTORE_PASSWD_X. */
+ public static final String AAI_TRUSTSTORE_PASSWD_X = "aai.truststore.passwd.x";
+
+ /** The Constant AAI_KEYSTORE_FILENAME. */
+ public static final String AAI_KEYSTORE_FILENAME = "aai.keystore.filename";
+
+ /** The Constant AAI_KEYSTORE_PASSWD_X. */
+ public static final String AAI_KEYSTORE_PASSWD_X = "aai.keystore.passwd.x";
+
+ /** The Constant AAI_VID_USERNAME. */
+ public static final String AAI_VID_USERNAME = "aai.vid.username";
+
+ /** The Constant AAI_VID_PASSWD_X. */
+ public static final String AAI_VID_PASSWD_X = "aai.vid.passwd.x";
+
+ /** The Constant FILESEPARTOR. */
+ public static final String FILESEPARTOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
+
+ /** The Constant AAI_USE_CLIENT_CERT */
+ public static final String AAI_USE_CLIENT_CERT = "aai.use.client.cert";
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
index d9bb5c1f4..13b7d30b0 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/AAIRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/AAIRestInterface.java
@@ -1,356 +1,373 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.aai.util;
-
-
-import java.io.UnsupportedEncodingException;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLEncoder;
-import java.security.KeyManagementException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Base64;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.aai.util.AAIProperties;
-import org.openecomp.aai.util.HttpsAuthClient;
-/**
- * The Class AAIRestInterface.
- */
-public class AAIRestInterface {
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AAIRestInterface.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The client. */
- private static Client client = null;
-
- /** The rest srvr base URL. */
- private String restSrvrBaseURL;
-
- /** The certificate path. */
- public String certificatePath = "";
-
- /**
- * Instantiates a new AAI rest interface.
- *
- * @param certPath the cert path
- */
- public AAIRestInterface(String certPath)
- {
- certificatePath = certPath;
- }
-
- /**
- * Encode URL.
- *
- * @param nodeKey the node key
- * @return the string
- * @throws UnsupportedEncodingException the unsupported encoding exception
- */
- public String encodeURL (String nodeKey) throws UnsupportedEncodingException {
- return URLEncoder.encode(nodeKey, "UTF-8").replaceAll("\\+", "%20");
- }
-
- /**
- * Inits the rest client.
- */
- private void initRestClient()
- {
- String methodName = "initRestClient";
-
- if (client == null) {
- try {
- client = HttpsAuthClient.getClient(certificatePath);
- }
- catch (KeyManagementException e){
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== KeyManagementException in " + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== KeyManagementException in " + methodName + e.toString());
- } catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== Exception in REST call to DB in initRestClient" + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== Exception in REST call to DB : " + e.toString());
- }
- }
- }
-
- /**
- * Sets the rest srvr base URL.
- *
- * @param baseURL the base URL
- */
- public void SetRestSrvrBaseURL(String baseURL)
- {
- if (baseURL == null)
- {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== REST Server base URL cannot be null.");
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== REST Server base URL cannot be null.");
- }
-
- restSrvrBaseURL = baseURL;
- }
-
- /**
- * Gets the rest srvr base URL.
- *
- * @return the rest srvr base URL
- */
- public String getRestSrvrBaseURL()
- {
- return restSrvrBaseURL;
- }
-
-
- /**
- * Rest get.
- *
- * @param fromAppId the from app id
- * @param transId the trans id
- * @param requestUri the request uri
- * @param xml the xml
- * @return the string
- * @throws UnsupportedEncodingException
- */
- public Response RestGet(String fromAppId, String transId, String requestUri, boolean xml) throws UnsupportedEncodingException {
- String methodName = "RestGet";
-
- String responseType = "application/json";
- if (xml)
- responseType = "application/xml";
-
- initRestClient();
-
- String clientCert = SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT);
-
- boolean useClientCert = false;
- if (clientCert != null &&
- SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
- useClientCert = true;
- }
- String url = "";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + requestUri;
-
- try {
- // what is the point of this, just to check syntax??
- URL urlObj= new URL(url);
- URI uri = new URI(urlObj.getProtocol(), urlObj.getUserInfo(), urlObj.getHost(), urlObj.getPort(), urlObj.getPath(), urlObj.getQuery(), urlObj.getRef());
- url = uri.toASCIIString();
- } catch (URISyntaxException | MalformedURLException e) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " bad URL");
- return null;
- }
- logger.debug(dateFormat.format(new Date()) + "<== " + url + " for the get REST API");
-
- final Response cres;
- if (useClientCert == true) {
- cres = client.target(url)
- .request()
- .accept(responseType)
- .header("X-TransactionId", transId)
- .header("X-FromAppId", fromAppId)
- .header("Content-Type", "application/json")
- .get();
- } else {
-
- String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
- String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
- String encodeThis = vidUsername + ":" + vidPassword;
-
- cres = client.target(url)
- .request()
- .accept(responseType)
- .header("X-TransactionId", transId)
- .header("X-FromAppId", fromAppId)
- .header("Content-Type", "application/json")
- .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
- .get();
- }
-// String r = cres.readEntity(String.class);
- if (cres.getStatus() == 200) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api GET was successful!");
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api GET was successful!");
- } else {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+", url="+url);
- }
- return cres;
-// logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" resp=" + r );
-// return r;
- }
-
-
- /**
- * Delete.
- *
- * @param sourceID the source ID
- * @param transId the trans id
- * @param path the path
- * @return true, if successful
- */
- public boolean Delete(String sourceID, String transId, String path) {
- String methodName = "Delete";
- String url="";
- transId += ":" + UUID.randomUUID().toString();
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- initRestClient();
- String request = "{}";
- url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
- final Response cres = client.target(url)
- .request()
- .accept("application/json")
- .header("X-TransactionId", transId)
- .header("X-FromAppId", sourceID)
- //.entity(request)
- .delete();
-
- if (cres.getStatus() == 404) { // resource not found
- String msg = "Resource does not exist...: " + cres.getStatus()
- + ":" + cres.readEntity(String.class);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
- return false;
- } else if (cres.getStatus() == 200 || cres.getStatus() == 204){
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
- return true;
- } else {
- String msg = "Deleting Resource failed: " + cres.getStatus()
- + ":" + cres.readEntity(String.class);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
- }
-
- return false;
- }
-
-
- /**
- * Rest put.
- *
- * @param fromAppId the from app id
- * @param transId the trans id
- * @param path the path
- * @param payload the payload
- * @param xml the xml
- * @return the string
- */
- public Response RestPut(String fromAppId, String transId, String path, String payload, boolean xml) {
- String methodName = "RestPost";
- String url="";
- transId = UUID.randomUUID().toString();
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
-
- String responseType = "application/json";
- if (xml)
- responseType = "application/xml";
-
- initRestClient();
-
- url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
-
- final Response cres = client.target(url)
- .request()
- .accept(responseType)
- .header("X-TransactionId", transId)
- .header("X-FromAppId", fromAppId)
- .put(Entity.entity(payload, MediaType.APPLICATION_JSON));
-
- if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- } else {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+", url="+url);
- }
- return cres;
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
- }
- return null;
- }
-
-
-
- /**
- * Rest post.
- *
- * @param fromAppId the from app id
- * @param transId the trans id
- * @param path the path
- * @param payload the payload
- * @param xml the xml
- * @return the string
- */
- public Response RestPost(String fromAppId, String transId, String path, String payload, boolean xml) {
- String methodName = "RestPost";
- String url="";
- transId = UUID.randomUUID().toString();
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
-
- String responseType = "application/json";
- if (xml)
- responseType = "application/xml";
-
- initRestClient();
-
- url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL_BASE) + path;
-
- String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
- String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
- String encodeThis = vidUsername + ":" + vidPassword;
-
- final Response cres = client.target(url)
- .request()
- .accept(responseType)
- .header("X-TransactionId", transId)
- .header("X-FromAppId", fromAppId)
- .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
- .post(Entity.entity(payload, MediaType.APPLICATION_JSON));
-
- if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- } else {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+", url="+url);
- }
- return cres;
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
- }
- return null;
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.vid.aai.util;
+
+
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.security.KeyManagementException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Base64;
+import java.util.Date;
+import java.util.UUID;
+
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.Entity;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.Response;
+
+import com.att.eelf.configuration.EELFLogger;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.eclipse.jetty.util.security.Password;
+import org.onap.vid.utils.Logging;
+import org.springframework.http.HttpMethod;
+import static org.onap.vid.utils.Logging.getHttpServletRequest;
+import static org.onap.vid.utils.Logging.requestIdHeaderKey;
+
+
+/**
+ * The Class AAIRestInterface.
+ */
+public class AAIRestInterface {
+
+ /** The logger. */
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AAIRestInterface.class);
+
+ final private EELFLogger outgoingRequestsLogger = Logging.getRequestsLogger("aai");
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /** The client. */
+ private static Client client = null;
+
+ /** The rest srvr base URL. */
+ private String restSrvrBaseURL;
+
+ /** The certificate path. */
+ public String certificatePath = "";
+
+ private String START_STRING = " start";
+
+ private String TRANSACTION_ID_HEADER = "X-TransactionId";
+ private String FROM_APP_ID_HEADER = "X-FromAppId";
+ private String SUCCESSFUL_API_MESSAGE=" REST api POST was successful!";
+ private String URL_DECLERATION = ", url=";
+
+
+
+
+
+
+ /**
+ * Instantiates a new AAI rest interface.
+ *
+ * @param certPath the cert path
+ */
+ public AAIRestInterface(String certPath)
+ {
+ certificatePath = certPath;
+ }
+
+ /**
+ * Encode URL.
+ *
+ * @param nodeKey the node key
+ * @return the string
+ * @throws UnsupportedEncodingException the unsupported encoding exception
+ */
+ public String encodeURL (String nodeKey) throws UnsupportedEncodingException {
+ return URLEncoder.encode(nodeKey, "UTF-8").replaceAll("\\+", "%20");
+ }
+
+ /**
+ * Inits the rest client.
+ */
+ private void initRestClient()
+ {
+ String methodName = "initRestClient";
+
+ if (client == null) {
+ try {
+ client = HttpsAuthClient.getClient(certificatePath);
+ }
+ catch (KeyManagementException e){
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== KeyManagementException in " + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== KeyManagementException in " + methodName + e.toString());
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== Exception in REST call to DB in initRestClient" + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== Exception in REST call to DB : " + e.toString());
+ }
+ }
+ }
+
+ /**
+ * Sets the rest srvr base URL.
+ *
+ * @param baseURL the base URL
+ */
+ public void SetRestSrvrBaseURL(String baseURL)
+ {
+ if (baseURL == null)
+ {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== REST Server base URL cannot be null.");
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== REST Server base URL cannot be null.");
+ }
+
+ restSrvrBaseURL = baseURL;
+ }
+
+ /**
+ * Gets the rest srvr base URL.
+ *
+ * @return the rest srvr base URL
+ */
+ public String getRestSrvrBaseURL()
+ {
+ return restSrvrBaseURL;
+ }
+
+
+ /**
+ * Rest get.
+ *
+ * @param fromAppId the from app id
+ * @param transId the trans id
+ * @param requestUri the request uri
+ * @param xml the xml
+ * @return the string
+ * @throws UnsupportedEncodingException
+ */
+ public Response RestGet(String fromAppId, String transId, String requestUri, boolean xml) throws UnsupportedEncodingException {
+ String methodName = "RestGet";
+
+ String responseType = MediaType.APPLICATION_JSON;
+ if (xml)
+ responseType = MediaType.APPLICATION_XML;
+
+ initRestClient();
+
+ String clientCert = SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT);
+
+ boolean useClientCert = false;
+ if (clientCert != null &&
+ SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
+ useClientCert = true;
+ }
+ String url = "";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START_STRING);
+
+ url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + requestUri;
+
+
+ logger.debug(dateFormat.format(new Date()) + "<== " + url + " for the get REST API");
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
+
+ final Response cres;
+ if (useClientCert == true) {
+ cres = client.target(url)
+ .request()
+ .accept(responseType)
+ .header(TRANSACTION_ID_HEADER, transId)
+ .header(FROM_APP_ID_HEADER, fromAppId)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get();
+ } else {
+
+ String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
+ String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
+ String encodeThis = vidUsername + ":" + vidPassword;
+
+ cres = client.target(url)
+ .request()
+ .accept(responseType)
+ .header(TRANSACTION_ID_HEADER, transId)
+ .header(FROM_APP_ID_HEADER, fromAppId)
+ .header("Content-Type", "application/json")
+ .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get();
+ }
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.GET, url, cres);
+// String r = cres.readEntity(String.class);
+ if (cres.getStatus() == 200) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + SUCCESSFUL_API_MESSAGE);
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + SUCCESSFUL_API_MESSAGE);
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+URL_DECLERATION+url);
+ }
+ return cres;
+// logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" resp=" + r );
+// return r;
+ }
+
+
+ /**
+ * Delete.
+ *
+ * @param sourceID the source ID
+ * @param transId the trans id
+ * @param path the path
+ * @return true, if successful
+ */
+ public boolean Delete(String sourceID, String transId, String path) {
+ String methodName = "Delete";
+ String url="";
+ transId += ":" + UUID.randomUUID().toString();
+ logger.debug(dateFormat.format(new Date()) + "<== " + methodName + START_STRING);
+
+ initRestClient();
+ String request = "{}";
+ url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.DELETE, url);
+ final Response cres = client.target(url)
+ .request()
+ .accept(MediaType.APPLICATION_JSON)
+ .header(TRANSACTION_ID_HEADER, transId)
+ .header(FROM_APP_ID_HEADER, sourceID)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ //.entity(request)
+ .delete();
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.DELETE, url, cres);
+ if (cres.getStatus() == 404) { // resource not found
+ String msg = "Resource does not exist...: " + cres.getStatus()
+ + ":" + cres.readEntity(String.class);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
+ return false;
+ } else if (cres.getStatus() == 200 || cres.getStatus() == 204){
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
+ return true;
+ } else {
+ String msg = "Deleting Resource failed: " + cres.getStatus()
+ + ":" + cres.readEntity(String.class);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + msg);
+ }
+
+ return false;
+ }
+
+
+ /**
+ * Rest put.
+ *
+ * @param fromAppId the from app id
+ * @param transId the trans id
+ * @param path the path
+ * @param payload the payload
+ * @param xml the xml
+ * @return the string
+ */
+ public Response RestPut(String fromAppId, String transId, String path, String payload, boolean xml) {
+ String methodName = "RestPut";
+ String url="";
+ transId = UUID.randomUUID().toString();
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START_STRING);
+
+ try {
+
+ String responseType = MediaType.APPLICATION_JSON;
+ if (xml)
+ responseType = "application/xml";
+
+ initRestClient();
+
+ url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL) + path;
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.PUT, url, payload);
+ final Response cres = client.target(url)
+ .request()
+ .accept(responseType)
+ .header(TRANSACTION_ID_HEADER, transId)
+ .header(FROM_APP_ID_HEADER, fromAppId)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .put(Entity.entity(payload, MediaType.APPLICATION_JSON));
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.PUT, url, cres);
+
+ if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +" with status="+cres.getStatus()+URL_DECLERATION+url);
+ }
+ return cres;
+ } catch (Exception e) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION+url+ ", Exception: " + e.toString());
+ }
+ return null;
+ }
+
+
+
+ /**
+ * Rest post.
+ *
+ * @param fromAppId the from app id
+ * @param transId the trans id
+ * @param path the path
+ * @param payload the payload
+ * @param xml the xml
+ * @return the string
+ */
+ public Response RestPost(String fromAppId, String transId, String path, String payload, boolean xml) {
+ String methodName = "RestPost";
+ String url="";
+ transId = UUID.randomUUID().toString();
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + START_STRING);
+
+ try {
+
+ String responseType = MediaType.APPLICATION_JSON;
+ if (xml)
+ responseType = "application/xml";
+
+ initRestClient();
+
+ url = SystemProperties.getProperty(AAIProperties.AAI_SERVER_URL_BASE) + path;
+ String vidUsername = SystemProperties.getProperty(AAIProperties.AAI_VID_USERNAME);
+ String vidPassword = Password.deobfuscate(SystemProperties.getProperty(AAIProperties.AAI_VID_PASSWD_X));
+ String encodeThis = vidUsername + ":" + vidPassword;
+
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.POST, url, payload);
+ final Response cres = client.target(url)
+ .request()
+ .accept(responseType)
+ .header(TRANSACTION_ID_HEADER, transId)
+ .header(FROM_APP_ID_HEADER, fromAppId)
+ .header("Authorization", "Basic " + Base64.getEncoder().encodeToString(encodeThis.getBytes("utf-8")))
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .post(Entity.entity(payload, MediaType.APPLICATION_JSON));
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.POST, url, cres);
+
+ if (cres.getStatus() == 200 && cres.getStatus() <= 299) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION);
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " with status="+cres.getStatus()+URL_DECLERATION+url);
+ }
+ return cres;
+ } catch (Exception e) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + URL_DECLERATION+url+ ", Exception: " + e.toString());
+ }
+ return null;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
index 1ed079219..996341a9c 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/CustomJacksonJaxBJsonProvider.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/CustomJacksonJaxBJsonProvider.java
@@ -1,73 +1,73 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import javax.ws.rs.ext.Provider;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.SerializationFeature;
-import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
-import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
-
-/**
- * The Class CustomJacksonJaxBJsonProvider.
- */
-@Provider
-public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider {
-
- /** The common mapper. */
- private static ObjectMapper commonMapper = null;
-
- /**
- * Instantiates a new custom jackson jax B json provider.
- */
- public CustomJacksonJaxBJsonProvider() {
- if (commonMapper == null) {
- ObjectMapper mapper = new ObjectMapper();
-
- mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
-
- mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
- mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
- mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
-
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
-
- mapper.registerModule(new JaxbAnnotationModule());
-
- commonMapper = mapper;
- }
- super.setMapper(commonMapper);
- }
-
- /**
- * Gets the mapper.
- *
- * @return the mapper
- */
- public ObjectMapper getMapper() {
- return commonMapper;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import javax.ws.rs.ext.Provider;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider;
+import com.fasterxml.jackson.module.jaxb.JaxbAnnotationModule;
+
+/**
+ * The Class CustomJacksonJaxBJsonProvider.
+ */
+@Provider
+public class CustomJacksonJaxBJsonProvider extends JacksonJaxbJsonProvider {
+
+ /** The common mapper. */
+ private static ObjectMapper commonMapper = null;
+
+ /**
+ * Instantiates a new custom jackson jax B json provider.
+ */
+ public CustomJacksonJaxBJsonProvider() {
+ if (commonMapper == null) {
+ ObjectMapper mapper = new ObjectMapper();
+
+ mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL);
+
+ mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false);
+ mapper.configure(SerializationFeature.INDENT_OUTPUT, false);
+ mapper.configure(SerializationFeature.WRAP_ROOT_VALUE, false);
+
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ mapper.configure(DeserializationFeature.UNWRAP_ROOT_VALUE, false);
+
+ mapper.registerModule(new JaxbAnnotationModule());
+
+ commonMapper = mapper;
+ }
+ super.setMapper(commonMapper);
+ }
+
+ /**
+ * Gets the mapper.
+ *
+ * @return the mapper
+ */
+ public ObjectMapper getMapper() {
+ return commonMapper;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
index 3323b3fb4..0cf32cd42 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsAuthClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsAuthClient.java
@@ -1,140 +1,140 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import java.io.FileInputStream;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.KeyManagerFactory;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.eclipse.jetty.util.security.Password;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.HttpUrlConnectorProvider;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-/**
- * The Class HttpsAuthClient.
- */
-public class HttpsAuthClient{
- /** The logger. */
- static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsAuthClient.class);
-
- /**
- * Gets the client.
- *
- * @param certFilePath the cert file path
- * @return the client
- * @throws KeyManagementException the key management exception
- */
- public static Client getClient(String certFilePath) throws KeyManagementException {
-
- ClientConfig config = new ClientConfig();
- //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
- //config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-
- try {
-
- config.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, Boolean.TRUE );
-
- config.connectorProvider(new HttpUrlConnectorProvider().useSetMethodWorkaround());
- String truststore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_FILENAME);
- String truststore_password = SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
- String decrypted_truststore_password = Password.deobfuscate(truststore_password);
-
- boolean useClientCert = false;
-
- String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
- String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
- String decrypted_keystore_password = Password.deobfuscate(keystore_password);
-
- String clientCert = SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT);
-
- if (clientCert != null &&
- SystemProperties.getProperty(AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
- useClientCert = true;
- }
-
- System.setProperty("javax.net.ssl.trustStore", truststore_path);
- System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
- HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
- public boolean verify(String string,SSLSession ssls) {
- return true;
- }
- });
-
- final SSLContext ctx = SSLContext.getInstance("TLS");
-
- KeyManagerFactory kmf = null;
- if (useClientCert) {
-
- try {
- kmf = KeyManagerFactory.getInstance("SunX509");
- FileInputStream fin = new FileInputStream(keystore_path);
- KeyStore ks = KeyStore.getInstance("PKCS12");
- char[] pwd = decrypted_keystore_password.toCharArray();
- ks.load(fin, pwd);
- kmf.init(ks, pwd);
- } catch (Exception e) {
- //System.out.println("Error setting up kmf: exiting");
- logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up kmf: exiting");
- e.printStackTrace();
- return null;
- }
- ctx.init(kmf.getKeyManagers(), null, null);
-
- return ClientBuilder.newBuilder()
- .sslContext(ctx)
- .hostnameVerifier(new HostnameVerifier() {
- @Override
- public boolean verify( String s, SSLSession sslSession ) {
- return true;
- }
- }).withConfig(config)
- .build()
- .register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
- } else {
- return ClientBuilder.newBuilder()
- .hostnameVerifier(new HostnameVerifier() {
- @Override
- public boolean verify( String s, SSLSession sslSession ) {
- return true;
- }
- }).withConfig(config)
- .build()
- .register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
- }
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
- //System.out.println("Error setting up config: exiting");
- e.printStackTrace();
- System.exit(1);
- return null;
- }
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import java.io.FileInputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.KeyManagerFactory;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.eclipse.jetty.util.security.Password;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.HttpUrlConnectorProvider;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+/**
+ * The Class HttpsAuthClient.
+ */
+public class HttpsAuthClient{
+ /** The logger. */
+ static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsAuthClient.class);
+
+ /**
+ * Gets the client.
+ *
+ * @param certFilePath the cert file path
+ * @return the client
+ * @throws KeyManagementException the key management exception
+ */
+ public static Client getClient(String certFilePath) throws KeyManagementException {
+
+ ClientConfig config = new ClientConfig();
+ //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
+ //config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
+
+ try {
+
+ config.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, Boolean.TRUE );
+
+ config.connectorProvider(new HttpUrlConnectorProvider().useSetMethodWorkaround());
+ String truststore_path = certFilePath + org.onap.vid.aai.util.AAIProperties.FILESEPARTOR + SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_TRUSTSTORE_FILENAME);
+ String truststore_password = SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
+ String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+
+ boolean useClientCert = false;
+
+ String keystore_path = certFilePath + org.onap.vid.aai.util.AAIProperties.FILESEPARTOR + SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_KEYSTORE_FILENAME);
+ String keystore_password = SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_KEYSTORE_PASSWD_X);
+ String decrypted_keystore_password = Password.deobfuscate(keystore_password);
+
+ String clientCert = SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_USE_CLIENT_CERT);
+
+ if (clientCert != null &&
+ SystemProperties.getProperty(org.onap.vid.aai.util.AAIProperties.AAI_USE_CLIENT_CERT).equalsIgnoreCase("true")) {
+ useClientCert = true;
+ }
+
+ System.setProperty("javax.net.ssl.trustStore", truststore_path);
+ System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
+ HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
+ public boolean verify(String string,SSLSession ssls) {
+ return true;
+ }
+ });
+
+ final SSLContext ctx = SSLContext.getInstance("TLS");
+
+ KeyManagerFactory kmf = null;
+ if (useClientCert) {
+
+ try {
+ kmf = KeyManagerFactory.getInstance("SunX509");
+ FileInputStream fin = new FileInputStream(keystore_path);
+ KeyStore ks = KeyStore.getInstance("PKCS12");
+ char[] pwd = decrypted_keystore_password.toCharArray();
+ ks.load(fin, pwd);
+ kmf.init(ks, pwd);
+ } catch (Exception e) {
+ //System.out.println("Error setting up kmf: exiting");
+ logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up kmf: exiting");
+ e.printStackTrace();
+ return null;
+ }
+ ctx.init(kmf.getKeyManagers(), null, null);
+
+ return ClientBuilder.newBuilder()
+ .sslContext(ctx)
+ .hostnameVerifier(new HostnameVerifier() {
+ @Override
+ public boolean verify( String s, SSLSession sslSession ) {
+ return true;
+ }
+ }).withConfig(config)
+ .build()
+ .register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+ } else {
+ return ClientBuilder.newBuilder()
+ .hostnameVerifier(new HostnameVerifier() {
+ @Override
+ public boolean verify( String s, SSLSession sslSession ) {
+ return true;
+ }
+ }).withConfig(config)
+ .build()
+ .register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+ }
+ } catch (Exception e) {
+ logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
+ //System.out.println("Error setting up config: exiting");
+ e.printStackTrace();
+ System.exit(1);
+ return null;
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
index a041c6520..54d7f4684 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/HttpsComponentsClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/HttpsComponentsClient.java
@@ -1,99 +1,99 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-import java.io.FileInputStream;
-import java.security.KeyManagementException;
-import java.security.KeyStore;
-
-import javax.net.ssl.SSLContext;
-
-import org.apache.http.conn.ssl.SSLContextBuilder;
-import org.apache.http.impl.client.CloseableHttpClient;
-import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
-import org.apache.http.impl.client.HttpClients;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-
-/**
- * The Class HttpsComponentsClient.
- */
-public class HttpsComponentsClient{
-
- /**
- * Gets the client.
- *
- * @param certFilePath the cert file path
- * @return the client
- * @throws KeyManagementException the key management exception
- */
- public static CloseableHttpClient getClient(String certFilePath) throws Exception {
- CloseableHttpClient httpclient = null;
- try {
-
- String truststore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_FILENAME);
- String truststore_password = SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
- String decrypted_truststore_password = Password.deobfuscate(truststore_password);
- String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
- String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
- String decrypted_keystore_password = Password.deobfuscate(keystore_password);
-
- SSLContextBuilder sslContextB = new SSLContextBuilder();
-
- KeyStore ks = KeyStore.getInstance("PKCS12");
- FileInputStream fin = new FileInputStream(keystore_path);
- char[] pwd = decrypted_keystore_password.toCharArray();
- ks.load(fin, pwd);
-
- sslContextB.loadKeyMaterial(ks, pwd);
-
- KeyStore ts = KeyStore.getInstance("JKS");
- FileInputStream fin1 = new FileInputStream(truststore_path);
- char[] pwd1 = decrypted_truststore_password.toCharArray();
- ts.load(fin1, pwd1);
-
- sslContextB.loadTrustMaterial(ts);
- sslContextB.loadKeyMaterial(ks, pwd);
- sslContextB.useTLS();
-
- SSLContext sslcontext = sslContextB.build();
-
- SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(
- sslcontext,
- new String[] { "TLSv1.1", "TLSv1.2" },
- null,
- SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER );
-
- httpclient = HttpClients.custom()
- .setSSLSocketFactory(sslFactory)
- .build();
-
-
- } catch (Exception e) {
- throw e;
- }
- return httpclient;
- }
-
-
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+import java.io.FileInputStream;
+import java.security.KeyManagementException;
+import java.security.KeyStore;
+
+import javax.net.ssl.SSLContext;
+
+import org.apache.http.conn.ssl.SSLContextBuilder;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.conn.ssl.SSLConnectionSocketFactory;
+import org.apache.http.impl.client.HttpClients;
+import org.eclipse.jetty.util.security.Password;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+
+/**
+ * The Class HttpsComponentsClient.
+ */
+public class HttpsComponentsClient{
+
+ /**
+ * Gets the client.
+ *
+ * @param certFilePath the cert file path
+ * @return the client
+ * @throws KeyManagementException the key management exception
+ */
+ public static CloseableHttpClient getClient(String certFilePath) throws Exception {
+ CloseableHttpClient httpclient = null;
+ try {
+
+ String truststore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_FILENAME);
+ String truststore_password = SystemProperties.getProperty(AAIProperties.AAI_TRUSTSTORE_PASSWD_X);
+ String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+ String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
+ String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
+ String decrypted_keystore_password = Password.deobfuscate(keystore_password);
+
+ SSLContextBuilder sslContextB = new SSLContextBuilder();
+
+ KeyStore ks = KeyStore.getInstance("PKCS12");
+ FileInputStream fin = new FileInputStream(keystore_path);
+ char[] pwd = decrypted_keystore_password.toCharArray();
+ ks.load(fin, pwd);
+
+ sslContextB.loadKeyMaterial(ks, pwd);
+
+ KeyStore ts = KeyStore.getInstance("JKS");
+ FileInputStream fin1 = new FileInputStream(truststore_path);
+ char[] pwd1 = decrypted_truststore_password.toCharArray();
+ ts.load(fin1, pwd1);
+
+ sslContextB.loadTrustMaterial(ts);
+ sslContextB.loadKeyMaterial(ks, pwd);
+ sslContextB.useTLS();
+
+ SSLContext sslcontext = sslContextB.build();
+
+ SSLConnectionSocketFactory sslFactory = new SSLConnectionSocketFactory(
+ sslcontext,
+ new String[] { "TLSv1.1", "TLSv1.2" },
+ null,
+ SSLConnectionSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER );
+
+ httpclient = HttpClients.custom()
+ .setSSLSocketFactory(sslFactory)
+ .build();
+
+
+ } catch (Exception e) {
+ throw e;
+ }
+ return httpclient;
+ }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java b/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
index e31b0c1c7..8a3ba88ff 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/aai/util/JettyObfuscationConversionCommandLineUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/aai/util/JettyObfuscationConversionCommandLineUtil.java
@@ -1,78 +1,78 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.aai.util;
-
-
-import org.apache.commons.cli.BasicParser;
-import org.apache.commons.cli.CommandLine;
-import org.apache.commons.cli.CommandLineParser;
-import org.apache.commons.cli.Options;
-import org.apache.commons.cli.ParseException;
-import org.eclipse.jetty.util.security.Password;
-
-
-public class JettyObfuscationConversionCommandLineUtil {
- /**
- * The main method.
- *
- * @param args the arguments
- */
- public static void main(String[] args){
- Options options = new Options();
- options.addOption("e", true, "obfuscate the given string");
- options.addOption("d", true, "deobfuscate the given string");
-
- CommandLineParser parser = new BasicParser();
-
- try {
- CommandLine cmd = parser.parse(options, args);
- String toProcess = null;
-
- if (cmd.hasOption("e")){
- toProcess = cmd.getOptionValue("e");
- String encoded = Password.obfuscate(toProcess);
- System.out.println(encoded);
- } else if (cmd.hasOption("d")) {
- toProcess = cmd.getOptionValue("d");
- String decoded_str = Password.deobfuscate(toProcess);
- System.out.println(decoded_str);
- } else {
- usage();
- }
- } catch (ParseException e) {
- System.out.println("failed to parse input");
- System.out.println(e.toString());
- usage();
- } catch (Exception e) {
- System.out.println("exception:" + e.toString());
- }
- }
-
- /**
- * Usage.
- */
- private static void usage(){
- System.out.println("usage:");;
- System.out.println("-e [string] to obfuscate");
- System.out.println("-d [string] to deobfuscate");
- System.out.println("-h help");
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.aai.util;
+
+
+import org.apache.commons.cli.BasicParser;
+import org.apache.commons.cli.CommandLine;
+import org.apache.commons.cli.CommandLineParser;
+import org.apache.commons.cli.Options;
+import org.apache.commons.cli.ParseException;
+import org.eclipse.jetty.util.security.Password;
+
+
+public class JettyObfuscationConversionCommandLineUtil {
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
+ public static void main(String[] args){
+ Options options = new Options();
+ options.addOption("e", true, "obfuscate the given string");
+ options.addOption("d", true, "deobfuscate the given string");
+
+ CommandLineParser parser = new BasicParser();
+
+ try {
+ CommandLine cmd = parser.parse(options, args);
+ String toProcess = null;
+
+ if (cmd.hasOption("e")){
+ toProcess = cmd.getOptionValue("e");
+ String encoded = Password.obfuscate(toProcess);
+ System.out.println(encoded);
+ } else if (cmd.hasOption("d")) {
+ toProcess = cmd.getOptionValue("d");
+ String decoded_str = Password.deobfuscate(toProcess);
+ System.out.println(decoded_str);
+ } else {
+ usage();
+ }
+ } catch (ParseException e) {
+ System.out.println("failed to parse input");
+ System.out.println(e.toString());
+ usage();
+ } catch (Exception e) {
+ System.out.println("exception:" + e.toString());
+ }
+ }
+
+ /**
+ * Usage.
+ */
+ private static void usage(){
+ System.out.println("usage:");;
+ System.out.println("-e [string] to obfuscate");
+ System.out.println("-d [string] to deobfuscate");
+ System.out.println("-h help");
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
index c80787205..01883d50e 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcCatalogException.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcCatalogException.java
@@ -1,58 +1,58 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc;
-
-/**
- * The Class AsdcCatalogException.
- */
-public class AsdcCatalogException extends Exception {
-
- /** The Constant serialVersionUID. */
- private static final long serialVersionUID = 1L;
-
- /**
- * Instantiates a new sdc catalog exception.
- *
- * @param msg the msg
- */
- public AsdcCatalogException(String msg) {
- super(msg);
- }
-
- /**
- * Instantiates a new sdc catalog exception.
- *
- * @param cause the cause
- */
- public AsdcCatalogException(Throwable cause) {
- super(cause);
- }
-
- /**
- * Instantiates a new sdc catalog exception.
- *
- * @param msg the msg
- * @param t the t
- */
- public AsdcCatalogException(String msg, Throwable t) {
- super(msg, t);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc;
+
+/**
+ * The Class AsdcCatalogException.
+ */
+public class AsdcCatalogException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Instantiates a new sdc catalog exception.
+ *
+ * @param msg the msg
+ */
+ public AsdcCatalogException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Instantiates a new sdc catalog exception.
+ *
+ * @param cause the cause
+ */
+ public AsdcCatalogException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Instantiates a new sdc catalog exception.
+ *
+ * @param msg the msg
+ * @param t the t
+ */
+ public AsdcCatalogException(String msg, Throwable t) {
+ super(msg, t);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
index 314ea037d..970ec954f 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/AsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/AsdcClient.java
@@ -1,129 +1,129 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc;
-
-import java.io.IOException;
-import java.nio.file.Path;
-import java.util.Collection;
-import java.util.Map;
-import java.util.UUID;
-
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-
-/**
- * The Interface AsdcClient.
- */
-public interface AsdcClient {
-
- /**
- * Gets the resource.
- *
- * @param uuid the uuid
- * @return the resource
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Resource getResource(UUID uuid) throws AsdcCatalogException;
-
- /**
- * Gets the resources.
- *
- * @return the resources
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Collection<Resource> getResources() throws AsdcCatalogException;
-
- /**
- * Gets the resources.
- *
- * @param filter the filter
- * @return the resources
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException;
-
- /**
- * Gets the resource artifact.
- *
- * @param resourceUuid the resource uuid
- * @param artifactUuid the artifact uuid
- * @return the resource artifact
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException;
-
- /**
- * Gets the resource tosca model.
- *
- * @param uuid the uuid
- * @return the resource tosca model
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Path getResourceToscaModel(UUID uuid) throws AsdcCatalogException;
-
- /**
- * Gets the service.
- *
- * @param uuid the uuid
- * @return the service
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Service getService(UUID uuid) throws AsdcCatalogException;
-
- /**
- * Gets the services.
- *
- * @return the services
- * @throws AsdcCatalogException the sdc catalog exception
- */
- public Collection<Service> getServices() throws AsdcCatalogException;
-
- /**
- * Gets the services.
- *
- * @param filter the filter
- * @return the services
- * @throws AsdcCatalogException the asdc catalog exception
- */
- public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException;
-
- /**
- * Gets the service artifact.
- *
- * @param serviceUuid the service uuid
- * @param artifactUuid the artifact uuid
- * @return the service artifact
- * @throws AsdcCatalogException the asdc catalog exception
- */
- public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException;
-
- /**
- * Gets the service tosca model.
- *
- * @param uuid the uuid
- * @return the service tosca model
- * @throws AsdcCatalogException the asdc catalog exception
- */
- public Path getServiceToscaModel(UUID uuid) throws AsdcCatalogException;
-
- //TODO: Collect TOSCA information from CSAR
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc;
+
+import java.io.IOException;
+import java.nio.file.Path;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
+
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+
+/**
+ * The Interface AsdcClient.
+ */
+public interface AsdcClient {
+
+ /**
+ * Gets the resource.
+ *
+ * @param uuid the uuid
+ * @return the resource
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Resource getResource(UUID uuid) throws AsdcCatalogException;
+
+ /**
+ * Gets the resources.
+ *
+ * @return the resources
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Collection<Resource> getResources() throws AsdcCatalogException;
+
+ /**
+ * Gets the resources.
+ *
+ * @param filter the filter
+ * @return the resources
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException;
+
+ /**
+ * Gets the resource artifact.
+ *
+ * @param resourceUuid the resource uuid
+ * @param artifactUuid the artifact uuid
+ * @return the resource artifact
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException;
+
+ /**
+ * Gets the resource tosca model.
+ *
+ * @param uuid the uuid
+ * @return the resource tosca model
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Path getResourceToscaModel(UUID uuid) throws AsdcCatalogException;
+
+ /**
+ * Gets the service.
+ *
+ * @param uuid the uuid
+ * @return the service
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Service getService(UUID uuid) throws AsdcCatalogException;
+
+ /**
+ * Gets the services.
+ *
+ * @return the services
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ public Collection<Service> getServices() throws AsdcCatalogException;
+
+ /**
+ * Gets the services.
+ *
+ * @param filter the filter
+ * @return the services
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException;
+
+ /**
+ * Gets the service artifact.
+ *
+ * @param serviceUuid the service uuid
+ * @param artifactUuid the artifact uuid
+ * @return the service artifact
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException;
+
+ /**
+ * Gets the service tosca model.
+ *
+ * @param uuid the uuid
+ * @return the service tosca model
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ public Path getServiceToscaModel(UUID uuid) throws AsdcCatalogException;
+
+ //TODO: Collect TOSCA information from CSAR
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
index 4974d44a8..c7e093ffb 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Artifact.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Artifact.java
@@ -1,314 +1,314 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.UUID;
-
-/**
- * The Class Artifact.
- */
-public class Artifact {
-
-/*
- * SDC has widened this to a String type for 1610.
- public enum Type {
- HEAT,
- HEAT_ENV,
- HEAT_VOL,
- HEAT_NET,
- HEAT_NESTED,
- HEAT_ARTIFACT,
- YANG_XML,
- VNF_CATALOG,
- VF_LICENSE,
- VENDOR_LICENSE,
- ASSET_INVENTORY_PROFILE,
- ASSET_QUERY_SPEC,
- APPC_CONFIG,
- VF_MODULES_METADATA,
- DCAE_TOSCA,
- DCAE_JSON,
- DCAE_EMF,
- DCAE_DOC,
- DCAE_BLUEPRINT,
- DCAE_EVENT,
- DCAE_INVENTORY_TOSCA,
- DCAE_INVENTORY_JSON,
- DCAE_INVENTORY_EMF,
- DCAE_INVENTORY_DOC,
- DCAE_INVENTORY_BLUEPRINT,
- DCAE_INVENTORY_EVENT,
- OTHER,
- AAI_SERVICE_MODEL //HEY! READ ME! YES, YOU! I AM A TEMPORARY FIX, PLEASE REMOVE ME BECAUSE I AM A FRAUD. I DON'T BELONG HERE.
- //Warm Regards,
- // *The* Artifact.Type.AAI_SERVICE_MODEL Constant
- }
- */
-
- /** The artifact name. */
- private String artifactName;
-
- /** The artifact label. */
- private String artifactLabel;
-
- /** The artifact group type. */
- private String artifactGroupType;
-
- /** The artifact type. */
- private String artifactType;
-
- /** The artifact URL. */
- private String artifactURL;
-
- /** The artifact description. */
- private String artifactDescription;
-
- /** The artifact timeout. */
- private int artifactTimeout;
-
- /** The artifact checksum. */
- private String artifactChecksum;
-
- /** The artifact UUID. */
- private String artifactUUID;
-
- /** The artifact version. */
- private String artifactVersion;
-
- /** The generated from UUID. */
- private String generatedFromUUID;
-
- /**
- * Gets the artifact name.
- *
- * @return the artifact name
- */
- public String getArtifactName() {
- return artifactName;
- }
-
- /**
- * Gets the artifact type.
- *
- * @return the artifact type
- */
- public String getArtifactType() {
- return artifactType;
- }
- /**
- * Gets the artifact group type.
- *
- * @return the artifact group type
- */
- public String getArtifactGroupType() {
- return artifactGroupType;
- }
-
- /**
- * Gets the artifact label.
- *
- * @return the artifact label
- */
- public String getArtifactLabel() {
- return artifactLabel;
- }
- /**
- * Gets the artifact URL.
- *
- * @return the artifact URL
- */
- public String getArtifactURL() {
- return artifactURL;
- }
-
- /**
- * Gets the artifact description.
- *
- * @return the artifact description
- */
- public String getArtifactDescription() {
- return artifactDescription;
- }
-
- /**
- * Gets the artifact timeout.
- *
- * @return the artifact timeout
- */
- public int getArtifactTimeout() {
- return artifactTimeout;
- }
-
- /**
- * Gets the artifact checksum.
- *
- * @return the artifact checksum
- */
- public String getArtifactChecksum() {
- return artifactChecksum;
- }
-
- /**
- * Gets the artifact UUID.
- *
- * @return the artifact UUID
- */
- public String getArtifactUUID() {
- return artifactUUID;
- }
-
- /**
- * Gets the artifact version.
- *
- * @return the artifact version
- */
- public String getArtifactVersion() {
- return artifactVersion;
- }
-
- /**
- * Gets the generated from UUID.
- *
- * @return the generated from UUID
- */
- public String getGeneratedFromUUID() {
- return generatedFromUUID;
- }
-
- /**
- * Sets the artifact name.
- *
- * @param artifactName the new artifact name
- */
- public void setArtifactName(String artifactName) {
- this.artifactName = artifactName;
- }
-
- /**
- * Sets the artifact type.
- *
- * @param artifactType the new artifact type
- */
- public void setArtifactType(String artifactType) {
- this.artifactType = artifactType;
- }
- /**
- * Sets the artifact group type.
- *
- * @param artifactGroupType the new artifact group type
- */
- public void setArtifactGroupType(String artifactGroupType) {
- this.artifactGroupType = artifactGroupType;
- }
- /**
- * Sets the artifact label.
- *
- * @param artifactGroupType the new artifact label
- */
- public void setArtifactLabel(String artifactLabel) {
- this.artifactLabel = artifactLabel;
- }
- /**
- * Sets the artifact URL.
- *
- * @param artifactURL the new artifact URL
- */
- public void setArtifactURL(String artifactURL) {
- this.artifactURL = artifactURL;
- }
-
- /**
- * Sets the artifact description.
- *
- * @param artifactDescription the new artifact description
- */
- public void setArtifactDescription(String artifactDescription) {
- this.artifactDescription = artifactDescription;
- }
-
- /**
- * Sets the artifact timeout.
- *
- * @param artifactTimeout the new artifact timeout
- */
- public void setArtifactTimeout(int artifactTimeout) {
- this.artifactTimeout = artifactTimeout;
- }
-
- /**
- * Sets the artifact checksum.
- *
- * @param artifactChecksum the new artifact checksum
- */
- public void setArtifactChecksum(String artifactChecksum) {
- this.artifactChecksum = artifactChecksum;
- }
-
- /**
- * Sets the artifact UUID.
- *
- * @param artifactUUID the new artifact UUID
- */
- public void setArtifactUUID(String artifactUUID) {
- this.artifactUUID = artifactUUID;
- }
-
- /**
- * Sets the artifact version.
- *
- * @param artifactVersion the new artifact version
- */
- public void setArtifactVersion(String artifactVersion) {
- this.artifactVersion = artifactVersion;
- }
-
- /**
- * Sets the generated from UUID.
- *
- * @param generatedFromUUID the new generated from UUID
- */
- public void setGeneratedFromUUID(String generatedFromUUID) {
- this.generatedFromUUID = generatedFromUUID;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final UUID uuid = UUID.fromString(getArtifactUUID());
-
- return uuid.hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof Artifact)) return false;
-
- final Artifact artifact = (Artifact) o;
-
- return (artifact.getArtifactUUID().equals(getArtifactUUID()));
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.UUID;
+
+/**
+ * The Class Artifact.
+ */
+public class Artifact {
+
+/*
+ * SDC has widened this to a String type for 1610.
+ public enum Type {
+ HEAT,
+ HEAT_ENV,
+ HEAT_VOL,
+ HEAT_NET,
+ HEAT_NESTED,
+ HEAT_ARTIFACT,
+ YANG_XML,
+ VNF_CATALOG,
+ VF_LICENSE,
+ VENDOR_LICENSE,
+ ASSET_INVENTORY_PROFILE,
+ ASSET_QUERY_SPEC,
+ APPC_CONFIG,
+ VF_MODULES_METADATA,
+ DCAE_TOSCA,
+ DCAE_JSON,
+ DCAE_EMF,
+ DCAE_DOC,
+ DCAE_BLUEPRINT,
+ DCAE_EVENT,
+ DCAE_INVENTORY_TOSCA,
+ DCAE_INVENTORY_JSON,
+ DCAE_INVENTORY_EMF,
+ DCAE_INVENTORY_DOC,
+ DCAE_INVENTORY_BLUEPRINT,
+ DCAE_INVENTORY_EVENT,
+ OTHER,
+ AAI_SERVICE_MODEL //HEY! READ ME! YES, YOU! I AM A TEMPORARY FIX, PLEASE REMOVE ME BECAUSE I AM A FRAUD. I DON'T BELONG HERE.
+ //Warm Regards,
+ // *The* Artifact.Type.AAI_SERVICE_MODEL Constant
+ }
+ */
+
+ /** The artifact name. */
+ private String artifactName;
+
+ /** The artifact label. */
+ private String artifactLabel;
+
+ /** The artifact group type. */
+ private String artifactGroupType;
+
+ /** The artifact type. */
+ private String artifactType;
+
+ /** The artifact URL. */
+ private String artifactURL;
+
+ /** The artifact description. */
+ private String artifactDescription;
+
+ /** The artifact timeout. */
+ private int artifactTimeout;
+
+ /** The artifact checksum. */
+ private String artifactChecksum;
+
+ /** The artifact UUID. */
+ private String artifactUUID;
+
+ /** The artifact version. */
+ private String artifactVersion;
+
+ /** The generated from UUID. */
+ private String generatedFromUUID;
+
+ /**
+ * Gets the artifact name.
+ *
+ * @return the artifact name
+ */
+ public String getArtifactName() {
+ return artifactName;
+ }
+
+ /**
+ * Gets the artifact type.
+ *
+ * @return the artifact type
+ */
+ public String getArtifactType() {
+ return artifactType;
+ }
+ /**
+ * Gets the artifact group type.
+ *
+ * @return the artifact group type
+ */
+ public String getArtifactGroupType() {
+ return artifactGroupType;
+ }
+
+ /**
+ * Gets the artifact label.
+ *
+ * @return the artifact label
+ */
+ public String getArtifactLabel() {
+ return artifactLabel;
+ }
+ /**
+ * Gets the artifact URL.
+ *
+ * @return the artifact URL
+ */
+ public String getArtifactURL() {
+ return artifactURL;
+ }
+
+ /**
+ * Gets the artifact description.
+ *
+ * @return the artifact description
+ */
+ public String getArtifactDescription() {
+ return artifactDescription;
+ }
+
+ /**
+ * Gets the artifact timeout.
+ *
+ * @return the artifact timeout
+ */
+ public int getArtifactTimeout() {
+ return artifactTimeout;
+ }
+
+ /**
+ * Gets the artifact checksum.
+ *
+ * @return the artifact checksum
+ */
+ public String getArtifactChecksum() {
+ return artifactChecksum;
+ }
+
+ /**
+ * Gets the artifact UUID.
+ *
+ * @return the artifact UUID
+ */
+ public String getArtifactUUID() {
+ return artifactUUID;
+ }
+
+ /**
+ * Gets the artifact version.
+ *
+ * @return the artifact version
+ */
+ public String getArtifactVersion() {
+ return artifactVersion;
+ }
+
+ /**
+ * Gets the generated from UUID.
+ *
+ * @return the generated from UUID
+ */
+ public String getGeneratedFromUUID() {
+ return generatedFromUUID;
+ }
+
+ /**
+ * Sets the artifact name.
+ *
+ * @param artifactName the new artifact name
+ */
+ public void setArtifactName(String artifactName) {
+ this.artifactName = artifactName;
+ }
+
+ /**
+ * Sets the artifact type.
+ *
+ * @param artifactType the new artifact type
+ */
+ public void setArtifactType(String artifactType) {
+ this.artifactType = artifactType;
+ }
+ /**
+ * Sets the artifact group type.
+ *
+ * @param artifactGroupType the new artifact group type
+ */
+ public void setArtifactGroupType(String artifactGroupType) {
+ this.artifactGroupType = artifactGroupType;
+ }
+ /**
+ * Sets the artifact label.
+ *
+ * @param artifactGroupType the new artifact label
+ */
+ public void setArtifactLabel(String artifactLabel) {
+ this.artifactLabel = artifactLabel;
+ }
+ /**
+ * Sets the artifact URL.
+ *
+ * @param artifactURL the new artifact URL
+ */
+ public void setArtifactURL(String artifactURL) {
+ this.artifactURL = artifactURL;
+ }
+
+ /**
+ * Sets the artifact description.
+ *
+ * @param artifactDescription the new artifact description
+ */
+ public void setArtifactDescription(String artifactDescription) {
+ this.artifactDescription = artifactDescription;
+ }
+
+ /**
+ * Sets the artifact timeout.
+ *
+ * @param artifactTimeout the new artifact timeout
+ */
+ public void setArtifactTimeout(int artifactTimeout) {
+ this.artifactTimeout = artifactTimeout;
+ }
+
+ /**
+ * Sets the artifact checksum.
+ *
+ * @param artifactChecksum the new artifact checksum
+ */
+ public void setArtifactChecksum(String artifactChecksum) {
+ this.artifactChecksum = artifactChecksum;
+ }
+
+ /**
+ * Sets the artifact UUID.
+ *
+ * @param artifactUUID the new artifact UUID
+ */
+ public void setArtifactUUID(String artifactUUID) {
+ this.artifactUUID = artifactUUID;
+ }
+
+ /**
+ * Sets the artifact version.
+ *
+ * @param artifactVersion the new artifact version
+ */
+ public void setArtifactVersion(String artifactVersion) {
+ this.artifactVersion = artifactVersion;
+ }
+
+ /**
+ * Sets the generated from UUID.
+ *
+ * @param generatedFromUUID the new generated from UUID
+ */
+ public void setGeneratedFromUUID(String generatedFromUUID) {
+ this.generatedFromUUID = generatedFromUUID;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final UUID uuid = UUID.fromString(getArtifactUUID());
+
+ return uuid.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Artifact)) return false;
+
+ final Artifact artifact = (Artifact) o;
+
+ return (artifact.getArtifactUUID().equals(getArtifactUUID()));
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
index 000aae1a9..6b5aa5320 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Resource.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Resource.java
@@ -1,429 +1,429 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-import java.util.UUID;
-
-/**
- * The Class Resource.
- */
-public class Resource {
-
- /**
- * The Enum Type.
- */
- public enum Type {
-
- /** The vf. */
- VF,
-
- /** The vfc. */
- VFC,
-
- /** The cp. */
- CP,
-
- /** The vl. */
- VL,
-
- /** The vfcmt. */
- VFCMT
- }
-
- /**
- * The Enum LifecycleState.
- */
- public enum LifecycleState {
-
- /** The not certified checkout. */
- NOT_CERTIFIED_CHECKOUT,
-
- /** The not certified checkin. */
- NOT_CERTIFIED_CHECKIN,
-
- /** The ready for certification. */
- READY_FOR_CERTIFICATION,
-
- /** The certification in progress. */
- CERTIFICATION_IN_PROGRESS,
-
- /** The certified. */
- CERTIFIED
- }
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant UUID. */
- private String invariantUUID;
-
- /** The name. */
- private String name;
-
- /** The description. */
- private String description;
-
- /** The version. */
- private String version;
-
- /** The tosca model URL. */
- private String toscaModelURL;
-
- /** The category. */
- private String category;
-
- /** The sub category. */
- private String subCategory;
-
- /** The resource type. */
- private Resource.Type resourceType;
-
- /** The lifecycle state. */
- private Resource.LifecycleState lifecycleState;
-
- /** The last updater user ID. */
- private String lastUpdaterUserId;
-
- /** The last updater full name. */
- private String lastUpdaterFullName;
-
- /** The tosca model. */
- private String toscaModel;
-
- /** The tosca resource name. */
- private String toscaResourceName;
-
- /** The artifacts. */
- private Collection<Artifact> artifacts;
-
- /** The resources. */
- private Collection<SubResource> resources;
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the invariant UUID.
- *
- * @return the invariant UUID
- */
- public String getInvariantUUID() {
- return invariantUUID;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the tosca model URL.
- *
- * @return the tosca model URL
- */
- public String getToscaModelURL() {
- return toscaModelURL;
- }
-
- /**
- * Gets the category.
- *
- * @return the category
- */
- public String getCategory() {
- return category;
- }
-
- /**
- * Gets the sub category.
- *
- * @return the sub category
- */
- public String getSubCategory() {
- return subCategory;
- }
-
- /**
- * Gets the resource type.
- *
- * @return the resource type
- */
- public Resource.Type getResourceType() {
- return resourceType;
- }
-
- /**
- * Gets the lifecycle state.
- *
- * @return the lifecycle state
- */
- public Resource.LifecycleState getLifecycleState() {
- return lifecycleState;
- }
-
- /**
- * Gets the last updater user ID.
- *
- * @return the last updater user ID
- */
- public String getLastUpdaterUserId() {
- return lastUpdaterUserId;
- }
-
- /**
- * Gets the last updater full name.
- *
- * @return the last updater full name
- */
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- /**
- * Gets the tosca model.
- *
- * @return the tosca model
- */
- public String getToscaModel() {
- return toscaModel;
- }
-
- /**
- * Gets the tosca resource name.
- *
- * @return the tosca resource name
- */
- public String getToscaResourceName() {
- return toscaResourceName;
- }
-
- /**
- * Gets the artifacts.
- *
- * @return the artifacts
- */
- public Collection<Artifact> getArtifacts() {
- return artifacts;
- }
-
- /**
- * Gets the resources.
- *
- * @return the resources
- */
- public Collection<SubResource> getResources() {
- return resources;
- }
-
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant UUID.
- *
- * @param invariantUUID the new invariant UUID
- */
- public void setInvariantUUID(String invariantUUID) {
- this.invariantUUID = invariantUUID;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
- /**
- * Sets the description.
- *
- * @param name the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
-
- /**
- * Sets the tosca model URL.
- *
- * @param toscaModelURL the new tosca model URL
- */
- public void setToscaModelURL(String toscaModelURL) {
- this.toscaModelURL = toscaModelURL;
- }
-
- /**
- * Sets the category.
- *
- * @param category the new category
- */
- public void setCategory(String category) {
- this.category = category;
- }
-
- /**
- * Sets the sub category.
- *
- * @param subCategory the new sub category
- */
- public void setSubCategory(String subCategory) {
- this.subCategory = subCategory;
- }
-
- /**
- * Sets the resource type.
- *
- * @param resourceType the new resource type
- */
- public void setResourceType(Resource.Type resourceType) {
- this.resourceType = resourceType;
- }
-
- /**
- * Sets the lifecycle state.
- *
- * @param lifecycleState the new lifecycle state
- */
- public void setLifecycleState(Resource.LifecycleState lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
- /**
- * Sets the last updater user ID.
- *
- * @param lastUpdaterUserId the new last updater user ID
- */
- public void setLastUpdaterUserId(String lastUpdaterUserId) {
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
- /**
- * Sets the last updater full name.
- *
- * @param lastUpdaterFullName the new last updater full name
- */
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- /**
- * Sets the tosca model.
- *
- * @param toscaModel the new tosca model
- */
- public void setToscaModel(String toscaModel) {
- this.toscaModel = toscaModel;
- }
-
- /**
- * Sets the tosca resource name.
- *
- * @param toscaResourceName the new tosca resource name
- */
- public void setToscaResourceName(String toscaResourceName) {
- this.toscaResourceName = toscaResourceName;
- }
-
- /**
- * Sets the artifacts.
- *
- * @param artifacts the new artifacts
- */
- public void setArtifacts(Collection<Artifact> artifacts) {
- this.artifacts = artifacts;
- }
-
- /**
- * Sets the resources.
- *
- * @param resources the new resources
- */
- public void setResources(Collection<SubResource> resources) {
- this.resources = resources;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final UUID uuid = UUID.fromString(getUuid());
-
- return uuid.hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof Resource)) return false;
-
- final Resource resource = (Resource) o;
-
- return (resource.getUuid().equals(getUuid()));
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+import java.util.UUID;
+
+/**
+ * The Class Resource.
+ */
+public class Resource {
+
+ /**
+ * The Enum Type.
+ */
+ public enum Type {
+
+ /** The vf. */
+ VF,
+
+ /** The vfc. */
+ VFC,
+
+ /** The cp. */
+ CP,
+
+ /** The vl. */
+ VL,
+
+ /** The vfcmt. */
+ VFCMT
+ }
+
+ /**
+ * The Enum LifecycleState.
+ */
+ public enum LifecycleState {
+
+ /** The not certified checkout. */
+ NOT_CERTIFIED_CHECKOUT,
+
+ /** The not certified checkin. */
+ NOT_CERTIFIED_CHECKIN,
+
+ /** The ready for certification. */
+ READY_FOR_CERTIFICATION,
+
+ /** The certification in progress. */
+ CERTIFICATION_IN_PROGRESS,
+
+ /** The certified. */
+ CERTIFIED
+ }
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant UUID. */
+ private String invariantUUID;
+
+ /** The name. */
+ private String name;
+
+ /** The description. */
+ private String description;
+
+ /** The version. */
+ private String version;
+
+ /** The tosca model URL. */
+ private String toscaModelURL;
+
+ /** The category. */
+ private String category;
+
+ /** The sub category. */
+ private String subCategory;
+
+ /** The resource type. */
+ private Resource.Type resourceType;
+
+ /** The lifecycle state. */
+ private Resource.LifecycleState lifecycleState;
+
+ /** The last updater user ID. */
+ private String lastUpdaterUserId;
+
+ /** The last updater full name. */
+ private String lastUpdaterFullName;
+
+ /** The tosca model. */
+ private String toscaModel;
+
+ /** The tosca resource name. */
+ private String toscaResourceName;
+
+ /** The artifacts. */
+ private Collection<Artifact> artifacts;
+
+ /** The resources. */
+ private Collection<SubResource> resources;
+
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * Gets the invariant UUID.
+ *
+ * @return the invariant UUID
+ */
+ public String getInvariantUUID() {
+ return invariantUUID;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the tosca model URL.
+ *
+ * @return the tosca model URL
+ */
+ public String getToscaModelURL() {
+ return toscaModelURL;
+ }
+
+ /**
+ * Gets the category.
+ *
+ * @return the category
+ */
+ public String getCategory() {
+ return category;
+ }
+
+ /**
+ * Gets the sub category.
+ *
+ * @return the sub category
+ */
+ public String getSubCategory() {
+ return subCategory;
+ }
+
+ /**
+ * Gets the resource type.
+ *
+ * @return the resource type
+ */
+ public Resource.Type getResourceType() {
+ return resourceType;
+ }
+
+ /**
+ * Gets the lifecycle state.
+ *
+ * @return the lifecycle state
+ */
+ public Resource.LifecycleState getLifecycleState() {
+ return lifecycleState;
+ }
+
+ /**
+ * Gets the last updater user ID.
+ *
+ * @return the last updater user ID
+ */
+ public String getLastUpdaterUserId() {
+ return lastUpdaterUserId;
+ }
+
+ /**
+ * Gets the last updater full name.
+ *
+ * @return the last updater full name
+ */
+ public String getLastUpdaterFullName() {
+ return lastUpdaterFullName;
+ }
+
+ /**
+ * Gets the tosca model.
+ *
+ * @return the tosca model
+ */
+ public String getToscaModel() {
+ return toscaModel;
+ }
+
+ /**
+ * Gets the tosca resource name.
+ *
+ * @return the tosca resource name
+ */
+ public String getToscaResourceName() {
+ return toscaResourceName;
+ }
+
+ /**
+ * Gets the artifacts.
+ *
+ * @return the artifacts
+ */
+ public Collection<Artifact> getArtifacts() {
+ return artifacts;
+ }
+
+ /**
+ * Gets the resources.
+ *
+ * @return the resources
+ */
+ public Collection<SubResource> getResources() {
+ return resources;
+ }
+
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant UUID.
+ *
+ * @param invariantUUID the new invariant UUID
+ */
+ public void setInvariantUUID(String invariantUUID) {
+ this.invariantUUID = invariantUUID;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+ /**
+ * Sets the description.
+ *
+ * @param name the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * Sets the tosca model URL.
+ *
+ * @param toscaModelURL the new tosca model URL
+ */
+ public void setToscaModelURL(String toscaModelURL) {
+ this.toscaModelURL = toscaModelURL;
+ }
+
+ /**
+ * Sets the category.
+ *
+ * @param category the new category
+ */
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ /**
+ * Sets the sub category.
+ *
+ * @param subCategory the new sub category
+ */
+ public void setSubCategory(String subCategory) {
+ this.subCategory = subCategory;
+ }
+
+ /**
+ * Sets the resource type.
+ *
+ * @param resourceType the new resource type
+ */
+ public void setResourceType(Resource.Type resourceType) {
+ this.resourceType = resourceType;
+ }
+
+ /**
+ * Sets the lifecycle state.
+ *
+ * @param lifecycleState the new lifecycle state
+ */
+ public void setLifecycleState(Resource.LifecycleState lifecycleState) {
+ this.lifecycleState = lifecycleState;
+ }
+
+ /**
+ * Sets the last updater user ID.
+ *
+ * @param lastUpdaterUserId the new last updater user ID
+ */
+ public void setLastUpdaterUserId(String lastUpdaterUserId) {
+ this.lastUpdaterUserId = lastUpdaterUserId;
+ }
+
+ /**
+ * Sets the last updater full name.
+ *
+ * @param lastUpdaterFullName the new last updater full name
+ */
+ public void setLastUpdaterFullName(String lastUpdaterFullName) {
+ this.lastUpdaterFullName = lastUpdaterFullName;
+ }
+
+ /**
+ * Sets the tosca model.
+ *
+ * @param toscaModel the new tosca model
+ */
+ public void setToscaModel(String toscaModel) {
+ this.toscaModel = toscaModel;
+ }
+
+ /**
+ * Sets the tosca resource name.
+ *
+ * @param toscaResourceName the new tosca resource name
+ */
+ public void setToscaResourceName(String toscaResourceName) {
+ this.toscaResourceName = toscaResourceName;
+ }
+
+ /**
+ * Sets the artifacts.
+ *
+ * @param artifacts the new artifacts
+ */
+ public void setArtifacts(Collection<Artifact> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ /**
+ * Sets the resources.
+ *
+ * @param resources the new resources
+ */
+ public void setResources(Collection<SubResource> resources) {
+ this.resources = resources;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final UUID uuid = UUID.fromString(getUuid());
+
+ return uuid.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Resource)) return false;
+
+ final Resource resource = (Resource) o;
+
+ return (resource.getUuid().equals(getUuid()));
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
index 1372472f5..b81a43893 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureService.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.asdc.beans;
+package org.onap.vid.asdc.beans;
/**
* Created by Oren on 6/27/17.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
index 0fcd79223..a6aa3de6f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SecureServices.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SecureServices.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.asdc.beans;
+package org.onap.vid.asdc.beans;
import java.util.Collection;
import java.util.List;
@@ -9,8 +9,7 @@ import java.util.List;
public class SecureServices {
private Collection<Service> services;
- //Disable roles until AAF integration finishes
- private boolean isReadOnly = false;
+ private boolean isReadOnly = true;
public void setServices(Collection<Service> services) {
this.services = services;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
index 2a83cbe3a..5f59b89e8 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/Service.java
@@ -1,351 +1,354 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-import java.util.UUID;
-/**
- * The Class Service.
- */
-public class Service {
-
- /**
- * The Enum DistributionStatus.
- */
- public enum DistributionStatus {
-
- /** The distribution not approved. */
- DISTRIBUTION_NOT_APPROVED,
-
- /** The distribution approved. */
- DISTRIBUTION_APPROVED,
-
- /** The distributed. */
- DISTRIBUTED,
-
- /** The distribution rejected. */
- DISTRIBUTION_REJECTED
- }
-
- /**
- * The Enum LifecycleState.
- */
- public enum LifecycleState {
-
- /** The not certified checkout. */
- NOT_CERTIFIED_CHECKOUT,
-
- /** The not certified checkin. */
- NOT_CERTIFIED_CHECKIN,
-
- /** The ready for certification. */
- READY_FOR_CERTIFICATION,
-
- /** The certification in progress. */
- CERTIFICATION_IN_PROGRESS,
-
- /** The certified. */
- CERTIFIED
- }
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant UUID. */
- private String invariantUUID;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
- /** The tosca model URL. */
- private String toscaModelURL;
-
- /** The category. */
- private String category;
-
- /** The lifecycle state. */
- private Service.LifecycleState lifecycleState;
-
- /** The last updater user uid. */
- private String lastUpdaterUserId;
-
- /** The last updater full name. */
- private String lastUpdaterFullName;
-
- /** The distribution status. */
- private Service.DistributionStatus distributionStatus;
-
- /** The artifacts. */
- private Collection<Artifact> artifacts;
-
- /** The resources. */
- private Collection<SubResource> resources;
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the invariant UUID.
- *
- * @return the invariant UUID
- */
- public String getInvariantUUID() {
- return invariantUUID;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the tosca model URL.
- *
- * @return the tosca model URL
- */
- public String getToscaModelURL() {
- return toscaModelURL;
- }
-
- /**
- * Gets the category.
- *
- * @return the category
- */
- public String getCategory() {
- return category;
- }
-
- /**
- * Gets the lifecycle state.
- *
- * @return the lifecycle state
- */
- public Service.LifecycleState getLifecycleState() {
- return lifecycleState;
- }
-
- /**
- * Gets the last updater user uid.
- *
- * @return the last updater user uid
- */
- public String getLastUpdaterUserId() {
- return lastUpdaterUserId;
- }
-
- /**
- * Gets the last updater full name.
- *
- * @return the last updater full name
- */
- public String getLastUpdaterFullName() {
- return lastUpdaterFullName;
- }
-
- /**
- * Gets the distribution status.
- *
- * @return the distribution status
- */
- public Service.DistributionStatus getDistributionStatus() {
- return distributionStatus;
- }
-
- /**
- * Gets the artifacts.
- *
- * @return the artifacts
- */
- public Collection<Artifact> getArtifacts() {
- return artifacts;
- }
-
- /**
- * Gets the resources.
- *
- * @return the resources
- */
- public Collection<SubResource> getResources() {
- return resources;
- }
-
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant UUID.
- *
- * @param invariantUUID the new invariant UUID
- */
- public void setInvariantUUID(String invariantUUID) {
- this.invariantUUID = invariantUUID;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
-
- /**
- * Sets the tosca model URL.
- *
- * @param toscaModelURL the new tosca model URL
- */
- public void setToscaModelURL(String toscaModelURL) {
- this.toscaModelURL = toscaModelURL;
- }
-
- /**
- * Sets the category.
- *
- * @param category the new category
- */
- public void setCategory(String category) {
- this.category = category;
- }
-
- /**
- * Sets the lifecycle state.
- *
- * @param lifecycleState the new lifecycle state
- */
- public void setLifecycleState(Service.LifecycleState lifecycleState) {
- this.lifecycleState = lifecycleState;
- }
-
- /**
- * Sets the last updater user uid.
- *
- * @param lastUpdaterUserId the new last updater user uid
- */
- public void set(String lastUpdaterUserId) {
- this.lastUpdaterUserId = lastUpdaterUserId;
- }
-
- /**
- * Sets the last updater full name.
- *
- * @param lastUpdaterFullName the new last updater full name
- */
- public void setLastUpdaterFullName(String lastUpdaterFullName) {
- this.lastUpdaterFullName = lastUpdaterFullName;
- }
-
- /**
- * Sets the distribution status.
- *
- * @param distributionStatus the new distribution status
- */
- public void setDistributionStatus(Service.DistributionStatus distributionStatus) {
- this.distributionStatus = distributionStatus;
- }
-
- /**
- * Sets the artifacts.
- *
- * @param artifacts the new artifacts
- */
- public void setArtifacts(Collection<Artifact> artifacts) {
- this.artifacts = artifacts;
- }
-
- /**
- * Sets the resources.
- *
- * @param resources the new resources
- */
- public void setResources(Collection<SubResource> resources) {
- this.resources = resources;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return uuid;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final UUID uuid = UUID.fromString(getUuid());
-
- return uuid.hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof Service)) return false;
-
- final Service service = (Service) o;
-
- return (service.getUuid().equals(getUuid()));
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+import java.util.UUID;
+/**
+ * The Class Service.
+ */
+public class Service {
+
+ /**
+ * The Enum DistributionStatus.
+ */
+ public enum DistributionStatus {
+
+ /** The distribution not approved. */
+ DISTRIBUTION_NOT_APPROVED,
+
+ /** The distribution approved. */
+ DISTRIBUTION_APPROVED,
+
+ /** The distributed. */
+ DISTRIBUTED,
+
+ /** The distribution rejected. */
+ DISTRIBUTION_REJECTED,
+
+ /** The destributed for tenant isolation. */
+ DISTRIBUTION_COMPLETE_OK
+ }
+
+ /**
+ * The Enum LifecycleState.
+ */
+ public enum LifecycleState {
+
+ /** The not certified checkout. */
+ NOT_CERTIFIED_CHECKOUT,
+
+ /** The not certified checkin. */
+ NOT_CERTIFIED_CHECKIN,
+
+ /** The ready for certification. */
+ READY_FOR_CERTIFICATION,
+
+ /** The certification in progress. */
+ CERTIFICATION_IN_PROGRESS,
+
+ /** The certified. */
+ CERTIFIED
+ }
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant UUID. */
+ private String invariantUUID;
+
+ /** The name. */
+ private String name;
+
+ /** The version. */
+ private String version;
+
+ /** The tosca model URL. */
+ private String toscaModelURL;
+
+ /** The category. */
+ private String category;
+
+ /** The lifecycle state. */
+ private Service.LifecycleState lifecycleState;
+
+ /** The last updater user uid. */
+ private String lastUpdaterUserId;
+
+ /** The last updater full name. */
+ private String lastUpdaterFullName;
+
+ /** The distribution status. */
+ private Service.DistributionStatus distributionStatus;
+
+ /** The artifacts. */
+ private Collection<Artifact> artifacts;
+
+ /** The resources. */
+ private Collection<SubResource> resources;
+
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * Gets the invariant UUID.
+ *
+ * @return the invariant UUID
+ */
+ public String getInvariantUUID() {
+ return invariantUUID;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the tosca model URL.
+ *
+ * @return the tosca model URL
+ */
+ public String getToscaModelURL() {
+ return toscaModelURL;
+ }
+
+ /**
+ * Gets the category.
+ *
+ * @return the category
+ */
+ public String getCategory() {
+ return category;
+ }
+
+ /**
+ * Gets the lifecycle state.
+ *
+ * @return the lifecycle state
+ */
+ public Service.LifecycleState getLifecycleState() {
+ return lifecycleState;
+ }
+
+ /**
+ * Gets the last updater user uid.
+ *
+ * @return the last updater user uid
+ */
+ public String getLastUpdaterUserId() {
+ return lastUpdaterUserId;
+ }
+
+ /**
+ * Gets the last updater full name.
+ *
+ * @return the last updater full name
+ */
+ public String getLastUpdaterFullName() {
+ return lastUpdaterFullName;
+ }
+
+ /**
+ * Gets the distribution status.
+ *
+ * @return the distribution status
+ */
+ public Service.DistributionStatus getDistributionStatus() {
+ return distributionStatus;
+ }
+
+ /**
+ * Gets the artifacts.
+ *
+ * @return the artifacts
+ */
+ public Collection<Artifact> getArtifacts() {
+ return artifacts;
+ }
+
+ /**
+ * Gets the resources.
+ *
+ * @return the resources
+ */
+ public Collection<SubResource> getResources() {
+ return resources;
+ }
+
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant UUID.
+ *
+ * @param invariantUUID the new invariant UUID
+ */
+ public void setInvariantUUID(String invariantUUID) {
+ this.invariantUUID = invariantUUID;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * Sets the tosca model URL.
+ *
+ * @param toscaModelURL the new tosca model URL
+ */
+ public void setToscaModelURL(String toscaModelURL) {
+ this.toscaModelURL = toscaModelURL;
+ }
+
+ /**
+ * Sets the category.
+ *
+ * @param category the new category
+ */
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ /**
+ * Sets the lifecycle state.
+ *
+ * @param lifecycleState the new lifecycle state
+ */
+ public void setLifecycleState(Service.LifecycleState lifecycleState) {
+ this.lifecycleState = lifecycleState;
+ }
+
+ /**
+ * Sets the last updater user uid.
+ *
+ * @param lastUpdaterUserId the new last updater user uid
+ */
+ public void set(String lastUpdaterUserId) {
+ this.lastUpdaterUserId = lastUpdaterUserId;
+ }
+
+ /**
+ * Sets the last updater full name.
+ *
+ * @param lastUpdaterFullName the new last updater full name
+ */
+ public void setLastUpdaterFullName(String lastUpdaterFullName) {
+ this.lastUpdaterFullName = lastUpdaterFullName;
+ }
+
+ /**
+ * Sets the distribution status.
+ *
+ * @param distributionStatus the new distribution status
+ */
+ public void setDistributionStatus(Service.DistributionStatus distributionStatus) {
+ this.distributionStatus = distributionStatus;
+ }
+
+ /**
+ * Sets the artifacts.
+ *
+ * @param artifacts the new artifacts
+ */
+ public void setArtifacts(Collection<Artifact> artifacts) {
+ this.artifacts = artifacts;
+ }
+
+ /**
+ * Sets the resources.
+ *
+ * @param resources the new resources
+ */
+ public void setResources(Collection<SubResource> resources) {
+ this.resources = resources;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return uuid;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final UUID uuid = UUID.fromString(getUuid());
+
+ return uuid.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Service)) return false;
+
+ final Service service = (Service) o;
+
+ return (service.getUuid().equals(getUuid()));
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
index cd3ec7fee..5f7811d64 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/SubResource.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/SubResource.java
@@ -1,175 +1,175 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans;
-
-import java.util.Collection;
-/**
- * The Class SubResource.
- */
-public class SubResource {
-
- /** The resource instance name. */
- private String resourceInstanceName;
-
- /** The resource name. */
- private String resourceName;
-
- /** The resource invariant UUID. */
- private String resourceInvariantUUID;
-
- /** The resource version. */
- private String resourceVersion;
-
- /** The resource type. */
- private String resourceType;
-
- /** The resource UUID. */
- private String resourceUUID;
-
- /** The artifacts. */
- private Collection<Artifact> artifacts;
-
- /**
- * Gets the resource instance name.
- *
- * @return the resource instance name
- */
- public String getResourceInstanceName() {
- return resourceInstanceName;
- }
-
- /**
- * Gets the resource name.
- *
- * @return the resource name
- */
- public String getResourceName() {
- return resourceName;
- }
-
- /**
- * Gets the resource invariant UUID.
- *
- * @return the resource invariant UUID
- */
- public String getResourceInvariantUUID() {
- return resourceInvariantUUID;
- }
-
- /**
- * Gets the resource version.
- *
- * @return the resource version
- */
- public String getResourceVersion() {
- return resourceVersion;
- }
-
- /**
- * Gets the resoucre type.
- *
- * @return the resoucre type
- */
- public String getResoucreType() {
- return resourceType;
- }
-
- /**
- * Gets the resource UUID.
- *
- * @return the resource UUID
- */
- public String getResourceUUID() {
- return resourceUUID;
- }
-
- /**
- * Gets the artifacts.
- *
- * @return the artifacts
- */
- public Collection<Artifact> getArtifacts() {
- return artifacts;
- }
-
- /**
- * Sets the resource instance name.
- *
- * @param resourceInstanceName the new resource instance name
- */
- public void setResourceInstanceName(String resourceInstanceName) {
- this.resourceInstanceName = resourceInstanceName;
- }
-
- /**
- * Sets the resource name.
- *
- * @param resourceName the new resource name
- */
- public void setResourceName(String resourceName) {
- this.resourceName = resourceName;
- }
-
- /**
- * Sets the resource invariant UUID.
- *
- * @param resourceInvariantUUID the new resource invariant UUID
- */
- public void setResourceInvariantUUID(String resourceInvariantUUID) {
- this.resourceInvariantUUID = resourceInvariantUUID;
- }
-
- /**
- * Sets the resource version.
- *
- * @param resourceVersion the new resource version
- */
- public void setResourceVersion(String resourceVersion) {
- this.resourceVersion = resourceVersion;
- }
-
- /**
- * Sets the resoucre type.
- *
- * @param resourceType the new resoucre type
- */
- public void setResoucreType(String resourceType) {
- this.resourceType = resourceType;
- }
-
- /**
- * Sets the resource UUID.
- *
- * @param resourceUUID the new resource UUID
- */
- public void setResourceUUID(String resourceUUID) {
- this.resourceUUID = resourceUUID;
- }
-
- /**
- * Sets the artifacts.
- *
- * @param artifacts the new artifacts
- */
- public void setArtifacts(Collection<Artifact> artifacts) {
- this.artifacts = artifacts;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans;
+
+import java.util.Collection;
+/**
+ * The Class SubResource.
+ */
+public class SubResource {
+
+ /** The resource instance name. */
+ private String resourceInstanceName;
+
+ /** The resource name. */
+ private String resourceName;
+
+ /** The resource invariant UUID. */
+ private String resourceInvariantUUID;
+
+ /** The resource version. */
+ private String resourceVersion;
+
+ /** The resource type. */
+ private String resourceType;
+
+ /** The resource UUID. */
+ private String resourceUUID;
+
+ /** The artifacts. */
+ private Collection<Artifact> artifacts;
+
+ /**
+ * Gets the resource instance name.
+ *
+ * @return the resource instance name
+ */
+ public String getResourceInstanceName() {
+ return resourceInstanceName;
+ }
+
+ /**
+ * Gets the resource name.
+ *
+ * @return the resource name
+ */
+ public String getResourceName() {
+ return resourceName;
+ }
+
+ /**
+ * Gets the resource invariant UUID.
+ *
+ * @return the resource invariant UUID
+ */
+ public String getResourceInvariantUUID() {
+ return resourceInvariantUUID;
+ }
+
+ /**
+ * Gets the resource version.
+ *
+ * @return the resource version
+ */
+ public String getResourceVersion() {
+ return resourceVersion;
+ }
+
+ /**
+ * Gets the resoucre type.
+ *
+ * @return the resoucre type
+ */
+ public String getResoucreType() {
+ return resourceType;
+ }
+
+ /**
+ * Gets the resource UUID.
+ *
+ * @return the resource UUID
+ */
+ public String getResourceUUID() {
+ return resourceUUID;
+ }
+
+ /**
+ * Gets the artifacts.
+ *
+ * @return the artifacts
+ */
+ public Collection<Artifact> getArtifacts() {
+ return artifacts;
+ }
+
+ /**
+ * Sets the resource instance name.
+ *
+ * @param resourceInstanceName the new resource instance name
+ */
+ public void setResourceInstanceName(String resourceInstanceName) {
+ this.resourceInstanceName = resourceInstanceName;
+ }
+
+ /**
+ * Sets the resource name.
+ *
+ * @param resourceName the new resource name
+ */
+ public void setResourceName(String resourceName) {
+ this.resourceName = resourceName;
+ }
+
+ /**
+ * Sets the resource invariant UUID.
+ *
+ * @param resourceInvariantUUID the new resource invariant UUID
+ */
+ public void setResourceInvariantUUID(String resourceInvariantUUID) {
+ this.resourceInvariantUUID = resourceInvariantUUID;
+ }
+
+ /**
+ * Sets the resource version.
+ *
+ * @param resourceVersion the new resource version
+ */
+ public void setResourceVersion(String resourceVersion) {
+ this.resourceVersion = resourceVersion;
+ }
+
+ /**
+ * Sets the resoucre type.
+ *
+ * @param resourceType the new resoucre type
+ */
+ public void setResoucreType(String resourceType) {
+ this.resourceType = resourceType;
+ }
+
+ /**
+ * Sets the resource UUID.
+ *
+ * @param resourceUUID the new resource UUID
+ */
+ public void setResourceUUID(String resourceUUID) {
+ this.resourceUUID = resourceUUID;
+ }
+
+ /**
+ * Sets the artifacts.
+ *
+ * @param artifacts the new artifacts
+ */
+ public void setArtifacts(Collection<Artifact> artifacts) {
+ this.artifacts = artifacts;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
index 0d3f17ae4..7aa13435d 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Capability.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Capability.java
@@ -1,140 +1,140 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * The Class Capability.
- */
-public class Capability {
-
- /** The type. */
- private String type; //FIXME: Make an enumeration?
-
- /** The description. */
- private String description;
-
- /** The occurrences. */
- private Collection<String> occurrences; //FIXME: Make an enumeration?
-
- /** The properties. */
- private Map<String, Property> properties;
-
- /** The valid source types. */
- private Collection<String> valid_source_types; //FIXME: Make an enumeration?
-
- /**
- * Instantiates a new capability.
- */
- public Capability() {}
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the occurrences.
- *
- * @return the occurrences
- */
- public Collection<String> getOccurrences() {
- return occurrences;
- }
-
- /**
- * Gets the properties.
- *
- * @return the properties
- */
- public Map<String, Property> getProperties() {
- return properties;
- }
-
- /**
- * Gets the valid source types.
- *
- * @return the valid source types
- */
- public Collection<String> getValid_source_types() {
- return valid_source_types;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the occurrences.
- *
- * @param occurrences the new occurrences
- */
- public void setOccurrences(Collection<String> occurrences) {
- this.occurrences = occurrences;
- }
-
- /**
- * Sets the properties.
- *
- * @param properties the properties
- */
- public void setProperties(Map<String, Property> properties) {
- this.properties = properties;
- }
-
- /**
- * Sets the valid source types.
- *
- * @param valid_source_types the new valid source types
- */
- public void setValid_source_types(Collection<String> valid_source_types) {
- this.valid_source_types = valid_source_types;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * The Class Capability.
+ */
+public class Capability {
+
+ /** The type. */
+ private String type; //FIXME: Make an enumeration?
+
+ /** The description. */
+ private String description;
+
+ /** The occurrences. */
+ private Collection<String> occurrences; //FIXME: Make an enumeration?
+
+ /** The properties. */
+ private Map<String, Property> properties;
+
+ /** The valid source types. */
+ private Collection<String> valid_source_types; //FIXME: Make an enumeration?
+
+ /**
+ * Instantiates a new capability.
+ */
+ public Capability() {}
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the occurrences.
+ *
+ * @return the occurrences
+ */
+ public Collection<String> getOccurrences() {
+ return occurrences;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public Map<String, Property> getProperties() {
+ return properties;
+ }
+
+ /**
+ * Gets the valid source types.
+ *
+ * @return the valid source types
+ */
+ public Collection<String> getValid_source_types() {
+ return valid_source_types;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the occurrences.
+ *
+ * @param occurrences the new occurrences
+ */
+ public void setOccurrences(Collection<String> occurrences) {
+ this.occurrences = occurrences;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param properties the properties
+ */
+ public void setProperties(Map<String, Property> properties) {
+ this.properties = properties;
+ }
+
+ /**
+ * Sets the valid source types.
+ *
+ * @param valid_source_types the new valid source types
+ */
+ public void setValid_source_types(Collection<String> valid_source_types) {
+ this.valid_source_types = valid_source_types;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
index a91f38312..118776cab 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Constraint.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Constraint.java
@@ -1,199 +1,199 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-package org.openecomp.vid.asdc.beans.tosca;
-import java.util.List;
-import java.util.ArrayList;
-
-/**
- * The Class Constraint.
- */
-
-public class Constraint {
- private List<Object> valid_values;
- private Object equal;
- private Object greater_than;
- private Object greater_or_equal;
- private Object less_than;
- private Object less_or_equal;
- private List<Object> in_range;
- private Object length;
- private Object min_length;
- private Object max_length;
-
- /**
- * Instantiates a new Constraint.
- */
- public Constraint() {
- valid_values = new ArrayList<Object>();
- in_range = new ArrayList<Object>();
- }
-
- /**
- * Gets the valid_values.
- *
- * @return the valid_values
- */
- public List<Object> getvalid_values() {
- return valid_values;
- }
- /**
- * Gets equal.
- *
- * @return equal
- */
- public Object getEqual() {
- return equal;
- }
- /**
- * Gets greater_than.
- *
- * @return greater_than
- */
- public Object getGreater_than() {
- return greater_than;
- }
- /**
- * Gets greater_or_equal.
- *
- * @return greater_or_equal
- */
- public Object getGreater_or_equal() {
- return greater_or_equal;
- }
- /**
- * Gets less_than.
- *
- * @return less_than
- */
- public Object getLess_than() {
- return less_than;
- }
- /**
- * Gets less_or_equal.
- *
- * @return less_or_equal
- */
- public Object getLess_or_equal() {
- return less_or_equal;
- }
- /**
- * Gets in_range.
- *
- * @return in_range
- */
- public List<Object> getIn_range() {
- return in_range;
- }
- /**
- * Gets length.
- *
- * @return length
- */
- public Object getLength() {
- return length;
- }
- /**
- * Gets min_length.
- *
- * @return min_length
- */
- public Object getMin_length() {
- return min_length;
- }
- /**
- * Gets max_length.
- *
- * @return max_length
- */
- public Object getMax_length() {
- return max_length;
- }
- /**
- * Sets the valid_values.
- *
- * @param op the new valid_values
- */
- public void setvalid_values(List<Object> vlist) {
- this.valid_values = vlist;
- }
- /**
- * Sets equal.
- *
- * @param e the new equal
- */
- public void setEqual(Object e) {
- this.equal = e;
- }
- /**
- * Sets greater_than.
- *
- * @param e the new greater_than
- */
- public void setGreater_than(Object e) {
- this.greater_than = e;
- }
- /**
- * Sets less_than.
- *
- * @param e the new less_than
- */
- public void setLess_than(Object e) {
- this.less_than = e;
- }
- /**
- * Sets in_range.
- *
- * @param e the new in_range
- */
- public void setIn_range(List<Object> e) {
- this.in_range = e;
- }
- /**
- * Sets length.
- *
- * @param e the length
- */
- public void setLength(Object e) {
- this.length = e;
- }
- /**
- * Sets min_length.
- *
- * @param e the min_length
- */
- public void setMin_length(Object e) {
- this.min_length = e;
- }
- /**
- * Sets max_length.
- *
- * @param e the max_length
- */
- public void setMax_length(Object e) {
- this.max_length = e;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "valid_values=" + valid_values;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+package org.onap.vid.asdc.beans.tosca;
+import java.util.List;
+import java.util.ArrayList;
+
+/**
+ * The Class Constraint.
+ */
+
+public class Constraint {
+ private List<Object> valid_values;
+ private Object equal;
+ private Object greater_than;
+ private Object greater_or_equal;
+ private Object less_than;
+ private Object less_or_equal;
+ private List<Object> in_range;
+ private Object length;
+ private Object min_length;
+ private Object max_length;
+
+ /**
+ * Instantiates a new Constraint.
+ */
+ public Constraint() {
+ valid_values = new ArrayList<Object>();
+ in_range = new ArrayList<Object>();
+ }
+
+ /**
+ * Gets the valid_values.
+ *
+ * @return the valid_values
+ */
+ public List<Object> getvalid_values() {
+ return valid_values;
+ }
+ /**
+ * Gets equal.
+ *
+ * @return equal
+ */
+ public Object getEqual() {
+ return equal;
+ }
+ /**
+ * Gets greater_than.
+ *
+ * @return greater_than
+ */
+ public Object getGreater_than() {
+ return greater_than;
+ }
+ /**
+ * Gets greater_or_equal.
+ *
+ * @return greater_or_equal
+ */
+ public Object getGreater_or_equal() {
+ return greater_or_equal;
+ }
+ /**
+ * Gets less_than.
+ *
+ * @return less_than
+ */
+ public Object getLess_than() {
+ return less_than;
+ }
+ /**
+ * Gets less_or_equal.
+ *
+ * @return less_or_equal
+ */
+ public Object getLess_or_equal() {
+ return less_or_equal;
+ }
+ /**
+ * Gets in_range.
+ *
+ * @return in_range
+ */
+ public List<Object> getIn_range() {
+ return in_range;
+ }
+ /**
+ * Gets length.
+ *
+ * @return length
+ */
+ public Object getLength() {
+ return length;
+ }
+ /**
+ * Gets min_length.
+ *
+ * @return min_length
+ */
+ public Object getMin_length() {
+ return min_length;
+ }
+ /**
+ * Gets max_length.
+ *
+ * @return max_length
+ */
+ public Object getMax_length() {
+ return max_length;
+ }
+ /**
+ * Sets the valid_values.
+ *
+ * @param op the new valid_values
+ */
+ public void setvalid_values(List<Object> vlist) {
+ this.valid_values = vlist;
+ }
+ /**
+ * Sets equal.
+ *
+ * @param e the new equal
+ */
+ public void setEqual(Object e) {
+ this.equal = e;
+ }
+ /**
+ * Sets greater_than.
+ *
+ * @param e the new greater_than
+ */
+ public void setGreater_than(Object e) {
+ this.greater_than = e;
+ }
+ /**
+ * Sets less_than.
+ *
+ * @param e the new less_than
+ */
+ public void setLess_than(Object e) {
+ this.less_than = e;
+ }
+ /**
+ * Sets in_range.
+ *
+ * @param e the new in_range
+ */
+ public void setIn_range(List<Object> e) {
+ this.in_range = e;
+ }
+ /**
+ * Sets length.
+ *
+ * @param e the length
+ */
+ public void setLength(Object e) {
+ this.length = e;
+ }
+ /**
+ * Sets min_length.
+ *
+ * @param e the min_length
+ */
+ public void setMin_length(Object e) {
+ this.min_length = e;
+ }
+ /**
+ * Sets max_length.
+ *
+ * @param e the max_length
+ */
+ public void setMax_length(Object e) {
+ this.max_length = e;
+ }
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "valid_values=" + valid_values;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
index 4d31faab1..2685b22b8 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Group.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Group.java
@@ -1,135 +1,135 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * The Class Group.
- */
-public class Group {
-
- /** The type. */
- private String type;
-
- /** The members. */
- private Collection<String> members;
-
- /** The metadata. */
- private ToscaMetadata metadata;
-
- /** The vf module type. */
- private String vf_module_type;
-
- /** The properties. */
- private Map<String, Object> properties;
-
- /**
- * Gets the metadata.
- *
- * @return the metadata
- */
- public ToscaMetadata getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata.
- *
- * @param metadata the new metadata
- */
- public void setMetadata(ToscaMetadata metadata) {
- this.metadata = metadata;
- }
-
- /**
- * Gets the members.
- *
- * @return the members
- */
- public Collection<String> getMembers() {
- return members;
- }
-
- /**
- * Sets the members.
- *
- * @param members the new members
- */
- public void setMembers(Collection<String> members) {
- this.members = members;
- }
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Gets the vf module type.
- *
- * @return the vf module type
- */
- public String getvf_module_type() {
- return vf_module_type;
- }
-
- /**
- * Sets the vf module type.
- *
- * @param vf_module_type the new vf module type
- */
- public void setvf_module_type(String vf_module_type) {
- this.vf_module_type = vf_module_type;
- }
-
- /**
- * Gets the properties.
- *
- * @return the properties
- */
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- /**
- * Sets the properties.
- *
- * @param properties the properties
- */
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * The Class Group.
+ */
+public class Group {
+
+ /** The type. */
+ private String type;
+
+ /** The members. */
+ private Collection<String> members;
+
+ /** The metadata. */
+ private ToscaMetadata metadata;
+
+ /** The vf module type. */
+ private String vf_module_type;
+
+ /** The properties. */
+ private Map<String, Object> properties;
+
+ /**
+ * Gets the metadata.
+ *
+ * @return the metadata
+ */
+ public ToscaMetadata getMetadata() {
+ return metadata;
+ }
+
+ /**
+ * Sets the metadata.
+ *
+ * @param metadata the new metadata
+ */
+ public void setMetadata(ToscaMetadata metadata) {
+ this.metadata = metadata;
+ }
+
+ /**
+ * Gets the members.
+ *
+ * @return the members
+ */
+ public Collection<String> getMembers() {
+ return members;
+ }
+
+ /**
+ * Sets the members.
+ *
+ * @param members the new members
+ */
+ public void setMembers(Collection<String> members) {
+ this.members = members;
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the vf module type.
+ *
+ * @return the vf module type
+ */
+ public String getvf_module_type() {
+ return vf_module_type;
+ }
+
+ /**
+ * Sets the vf module type.
+ *
+ * @param vf_module_type the new vf module type
+ */
+ public void setvf_module_type(String vf_module_type) {
+ this.vf_module_type = vf_module_type;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param properties the properties
+ */
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
index d64a58066..dcd66e605 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Import.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Import.java
@@ -1,48 +1,48 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class Import.
- */
-public class Import {
-
- /** The file. */
- private String file;
-
- /**
- * Gets the file.
- *
- * @return the file
- */
- public String getFile() {
- return file;
- }
-
- /**
- * Sets the file.
- *
- * @param file the new file
- */
- public void setFile(String file) {
- this.file = file;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class Import.
+ */
+public class Import {
+
+ /** The file. */
+ private String file;
+
+ /**
+ * Gets the file.
+ *
+ * @return the file
+ */
+ public String getFile() {
+ return file;
+ }
+
+ /**
+ * Sets the file.
+ *
+ * @param file the new file
+ */
+ public void setFile(String file) {
+ this.file = file;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
index e5eec0121..e485a65e2 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Input.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Input.java
@@ -1,168 +1,168 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import org.openecomp.sdc.toscaparser.api.elements.constraints.*;
-
-import java.util.List;
-import java.util.ArrayList;
-
-// TODO: Auto-generated Javadoc
-/**
- * The Class Input.
- */
-public class Input {
-
- /** The type. */
- private String type;
-
- /** The description. */
- private String description;
-
- /** The default. */
- private Object _default;
-
- /** The entry schema. */
- private Input entry_schema;
-
- /** The constraints */
- private List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> constraints;
-
- /** The required field. If not set, the default is true */
- private boolean required = true;
-
- /**
- * Instantiates a new input.
- */
- public Input() {
- constraints = new ArrayList<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint>();
- }
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
- /**
- * Gets the required field.
- *
- * @return the required field
- */
- public boolean getRequired() {
- return required;
- }
- /**
- * Sets the required value.
- *
- * @param required the new required value
- */
- public void setRequired(boolean required) {
- this.required = required;
- }
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Gets the default.
- *
- * @return the default
- */
- public Object getDefault() {
- return _default;
- }
-
- /**
- * Sets the default.
- *
- * @param _default the new default
- */
- public void setDefault(Object _default) {
- this._default = _default;
- }
-
- /**
- * Gets the entry schema.
- *
- * @return the entry schema
- */
- public Input getentry_schema() {
- return entry_schema;
- }
- /**
- * Sets the entry schema.
- *
- * @param the entry schema
- */
- public void setentry_schema(Input s) {
- this.entry_schema = s;
- }
- /**
- * Sets the constraints.
- *
- * @param c the new constraints
- */
- public void setConstraints(List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> c) {
- this.constraints = c;
- }
- /**
- * Gets the constraints
- *
- * @return the constraints
- */
- public List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> getConstraints() {
- return constraints;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return "type=" + type + ",description=" + description + ",default=" + _default;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import org.openecomp.sdc.toscaparser.api.elements.constraints.*;
+
+import java.util.List;
+import java.util.ArrayList;
+
+// TODO: Auto-generated Javadoc
+/**
+ * The Class Input.
+ */
+public class Input {
+
+ /** The type. */
+ private String type;
+
+ /** The description. */
+ private String description;
+
+ /** The default. */
+ private Object _default;
+
+ /** The entry schema. */
+ private Input entry_schema;
+
+ /** The constraints */
+ private List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> constraints;
+
+ /** The required field. If not set, the default is true */
+ private boolean required = true;
+
+ /**
+ * Instantiates a new input.
+ */
+ public Input() {
+ constraints = new ArrayList<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint>();
+ }
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+ /**
+ * Gets the required field.
+ *
+ * @return the required field
+ */
+ public boolean getRequired() {
+ return required;
+ }
+ /**
+ * Sets the required value.
+ *
+ * @param required the new required value
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the default.
+ *
+ * @return the default
+ */
+ public Object getDefault() {
+ return _default;
+ }
+
+ /**
+ * Sets the default.
+ *
+ * @param _default the new default
+ */
+ public void setDefault(Object _default) {
+ this._default = _default;
+ }
+
+ /**
+ * Gets the entry schema.
+ *
+ * @return the entry schema
+ */
+ public Input getentry_schema() {
+ return entry_schema;
+ }
+ /**
+ * Sets the entry schema.
+ *
+ * @param the entry schema
+ */
+ public void setentry_schema(Input s) {
+ this.entry_schema = s;
+ }
+ /**
+ * Sets the constraints.
+ *
+ * @param c the new constraints
+ */
+ public void setConstraints(List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> c) {
+ this.constraints = c;
+ }
+ /**
+ * Gets the constraints
+ *
+ * @return the constraints
+ */
+ public List<org.openecomp.sdc.toscaparser.api.elements.constraints.Constraint> getConstraints() {
+ return constraints;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return "type=" + type + ",description=" + description + ",default=" + _default;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
index 97740b3f5..28210b2ec 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/NodeTemplate.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/NodeTemplate.java
@@ -1,117 +1,117 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * The Class NodeTemplate.
- */
-public class NodeTemplate {
-
- /** The type. */
- private String type;
-
- /** The metadata. */
- private ToscaMetadata metadata;
-
- /** The properties. */
- private Map<String, Object> properties; //HEAT?
-
- /** The requirements. */
- private Object requirements;
-
- public NodeTemplate () {
- properties = new HashMap<String,Object>();
- }
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Gets the metadata.
- *
- * @return the metadata
- */
- public ToscaMetadata getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata.
- *
- * @param metadata the new metadata
- */
- public void setMetadata(ToscaMetadata metadata) {
- this.metadata = metadata;
- }
-
- /**
- * Gets the properties.
- *
- * @return the properties
- */
- public Map<String, Object> getProperties() {
- return properties;
- }
-
- /**
- * Sets the properties.
- *
- * @param properties the properties
- */
- public void setProperties(Map<String, Object> properties) {
- this.properties = properties;
- }
-
- /**
- * Gets the requirements.
- *
- * @return the requirements
- */
- public Object getRequirements() {
- return requirements;
- }
-
- /**
- * Sets the requirements.
- *
- * @param requirements the new requirements
- */
- public void setRequirements(Object requirements) {
- this.requirements = requirements;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * The Class NodeTemplate.
+ */
+public class NodeTemplate {
+
+ /** The type. */
+ private String type;
+
+ /** The metadata. */
+ private ToscaMetadata metadata;
+
+ /** The properties. */
+ private Map<String, Object> properties; //HEAT?
+
+ /** The requirements. */
+ private Object requirements;
+
+ public NodeTemplate () {
+ properties = new HashMap<String,Object>();
+ }
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Gets the metadata.
+ *
+ * @return the metadata
+ */
+ public ToscaMetadata getMetadata() {
+ return metadata;
+ }
+
+ /**
+ * Sets the metadata.
+ *
+ * @param metadata the new metadata
+ */
+ public void setMetadata(ToscaMetadata metadata) {
+ this.metadata = metadata;
+ }
+
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public Map<String, Object> getProperties() {
+ return properties;
+ }
+
+ /**
+ * Sets the properties.
+ *
+ * @param properties the properties
+ */
+ public void setProperties(Map<String, Object> properties) {
+ this.properties = properties;
+ }
+
+ /**
+ * Gets the requirements.
+ *
+ * @return the requirements
+ */
+ public Object getRequirements() {
+ return requirements;
+ }
+
+ /**
+ * Sets the requirements.
+ *
+ * @param requirements the new requirements
+ */
+ public void setRequirements(Object requirements) {
+ this.requirements = requirements;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
index 16b921e2a..107f5c82f 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Property.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Property.java
@@ -1,157 +1,157 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class Property.
- */
-public class Property {
-
- /** The type. */
- private String type;
-
- /** The description. */
- private String description;
-
- /** The entry schema. */
- private Schema entry_schema;
-
- /** The default. */
- private String _default;
-
- /** The required. */
- private boolean required;
-
- /**
- * Instantiates a new property.
- */
- private Property() {}
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the entry schema.
- *
- * @return the entry schema
- */
- public Schema getEntry_schema() {
- return entry_schema;
- }
-
- /**
- * Gets the default.
- *
- * @return the default
- */
- public String get_default() {
- return _default;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the entry schema.
- *
- * @param entry_schema the new entry schema
- */
- public void setEntry_schema(Schema entry_schema) {
- this.entry_schema = entry_schema;
- }
-
- /**
- * Sets the default.
- *
- * @param _default the new default
- */
- public void set_default(String _default) {
- this._default = _default;
- }
-
- /**
- * Gets the default.
- *
- * @return the default
- */
- public String getDefault() {
- return _default;
- }
-
- /**
- * Checks if is required.
- *
- * @return true, if is required
- */
- public boolean isRequired() {
- return required;
- }
-
- /**
- * Sets the default.
- *
- * @param _default the new default
- */
- public void setDefault(String _default) {
- this._default = _default;
- }
-
- /**
- * Sets the required.
- *
- * @param required the new required
- */
- public void setRequired(boolean required) {
- this.required = required;
- }
-
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class Property.
+ */
+public class Property {
+
+ /** The type. */
+ private String type;
+
+ /** The description. */
+ private String description;
+
+ /** The entry schema. */
+ private Schema entry_schema;
+
+ /** The default. */
+ private String _default;
+
+ /** The required. */
+ private boolean required;
+
+ /**
+ * Instantiates a new property.
+ */
+ private Property() {}
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the entry schema.
+ *
+ * @return the entry schema
+ */
+ public Schema getEntry_schema() {
+ return entry_schema;
+ }
+
+ /**
+ * Gets the default.
+ *
+ * @return the default
+ */
+ public String get_default() {
+ return _default;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the entry schema.
+ *
+ * @param entry_schema the new entry schema
+ */
+ public void setEntry_schema(Schema entry_schema) {
+ this.entry_schema = entry_schema;
+ }
+
+ /**
+ * Sets the default.
+ *
+ * @param _default the new default
+ */
+ public void set_default(String _default) {
+ this._default = _default;
+ }
+
+ /**
+ * Gets the default.
+ *
+ * @return the default
+ */
+ public String getDefault() {
+ return _default;
+ }
+
+ /**
+ * Checks if is required.
+ *
+ * @return true, if is required
+ */
+ public boolean isRequired() {
+ return required;
+ }
+
+ /**
+ * Sets the default.
+ *
+ * @param _default the new default
+ */
+ public void setDefault(String _default) {
+ this._default = _default;
+ }
+
+ /**
+ * Sets the required.
+ *
+ * @param required the new required
+ */
+ public void setRequired(boolean required) {
+ this.required = required;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
index acb250997..0c2f88493 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Requirement.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Requirement.java
@@ -1,120 +1,120 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-
-/**
- * The Class Requirement.
- */
-public class Requirement {
-
- /** The occurrences. */
- private Collection<String> occurrences;
-
- /** The capability. */
- private String capability;
-
- /** The node. */
- private String node;
-
- /** The relationship. */
- private String relationship;
-
- /**
- * Instantiates a new requirement.
- */
- private Requirement() {}
-
- /**
- * Gets the occurrences.
- *
- * @return the occurrences
- */
- public Collection<String> getOccurrences() {
- return occurrences;
- }
-
- /**
- * Gets the capability.
- *
- * @return the capability
- */
- public String getCapability() {
- return capability;
- }
-
- /**
- * Gets the node.
- *
- * @return the node
- */
- public String getNode() {
- return node;
- }
-
- /**
- * Gets the relationship.
- *
- * @return the relationship
- */
- public String getRelationship() {
- return relationship;
- }
-
- /**
- * Sets the occurrences.
- *
- * @param occurrences the new occurrences
- */
- public void setOccurrences(Collection<String> occurrences) {
- this.occurrences = occurrences;
- }
-
- /**
- * Sets the capability.
- *
- * @param capability the new capability
- */
- public void setCapability(String capability) {
- this.capability = capability;
- }
-
- /**
- * Sets the node.
- *
- * @param node the new node
- */
- public void setNode(String node) {
- this.node = node;
- }
-
- /**
- * Sets the relationship.
- *
- * @param relationship the new relationship
- */
- public void setRelationship(String relationship) {
- this.relationship = relationship;
- }
-
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+
+/**
+ * The Class Requirement.
+ */
+public class Requirement {
+
+ /** The occurrences. */
+ private Collection<String> occurrences;
+
+ /** The capability. */
+ private String capability;
+
+ /** The node. */
+ private String node;
+
+ /** The relationship. */
+ private String relationship;
+
+ /**
+ * Instantiates a new requirement.
+ */
+ private Requirement() {}
+
+ /**
+ * Gets the occurrences.
+ *
+ * @return the occurrences
+ */
+ public Collection<String> getOccurrences() {
+ return occurrences;
+ }
+
+ /**
+ * Gets the capability.
+ *
+ * @return the capability
+ */
+ public String getCapability() {
+ return capability;
+ }
+
+ /**
+ * Gets the node.
+ *
+ * @return the node
+ */
+ public String getNode() {
+ return node;
+ }
+
+ /**
+ * Gets the relationship.
+ *
+ * @return the relationship
+ */
+ public String getRelationship() {
+ return relationship;
+ }
+
+ /**
+ * Sets the occurrences.
+ *
+ * @param occurrences the new occurrences
+ */
+ public void setOccurrences(Collection<String> occurrences) {
+ this.occurrences = occurrences;
+ }
+
+ /**
+ * Sets the capability.
+ *
+ * @param capability the new capability
+ */
+ public void setCapability(String capability) {
+ this.capability = capability;
+ }
+
+ /**
+ * Sets the node.
+ *
+ * @param node the new node
+ */
+ public void setNode(String node) {
+ this.node = node;
+ }
+
+ /**
+ * Sets the relationship.
+ *
+ * @param relationship the new relationship
+ */
+ public void setRelationship(String relationship) {
+ this.relationship = relationship;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
index f77c1b4b5..7bf347708 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/Schema.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/Schema.java
@@ -1,53 +1,53 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class Schema.
- */
-public class Schema {
-
- /** The type. */
- public String type;
-
- /**
- * Instantiates a new schema.
- */
- public Schema() {}
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class Schema.
+ */
+public class Schema {
+
+ /** The type. */
+ public String type;
+
+ /**
+ * Instantiates a new schema.
+ */
+ public Schema() {}
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
index f59f24674..70779c5f2 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/SubstitutionMappings.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/SubstitutionMappings.java
@@ -1,101 +1,101 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The Class SubstitutionMappings.
- */
-public class SubstitutionMappings {
-
- /** The node type. */
- private String node_type;
-
- /** The capabilities. */
- private Map<String, Object> capabilities;
-
- /** The requirements. */
- private Map<String, Object> requirements;
-
- /**
- * Instantiates a new substitution mappings.
- */
- public SubstitutionMappings() {
- capabilities = new HashMap<String, Object> ();
- requirements = new HashMap<String, Object> ();
- }
-
- /**
- * Gets the node type.
- *
- * @return the node type
- */
- public String getnode_type() {
- return node_type;
- }
-
- /**
- * Sets the node type.
- *
- * @param node_type the new node type
- */
- public void setnode_type(String node_type) {
- this.node_type = node_type;
- }
-
- /**
- * Gets the capabilities.
- *
- * @return the capabilities
- */
- public Map<String, Object> getCapabilities() {
- return capabilities;
- }
-
- /**
- * Sets the capabilities.
- *
- * @param capabilities the capabilities
- */
- public void setCapabilities(Map<String, Object> capabilities) {
- this.capabilities = capabilities;
- }
-
- /**
- * Gets the requirements.
- *
- * @return the requirements
- */
- public Map<String, Object> getRequirements() {
- return requirements;
- }
-
- /**
- * Sets the requirements.
- *
- * @param requirements the requirements
- */
- public void setRequirements(Map<String, Object> requirements) {
- this.requirements = requirements;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The Class SubstitutionMappings.
+ */
+public class SubstitutionMappings {
+
+ /** The node type. */
+ private String node_type;
+
+ /** The capabilities. */
+ private Map<String, Object> capabilities;
+
+ /** The requirements. */
+ private Map<String, Object> requirements;
+
+ /**
+ * Instantiates a new substitution mappings.
+ */
+ public SubstitutionMappings() {
+ capabilities = new HashMap<String, Object> ();
+ requirements = new HashMap<String, Object> ();
+ }
+
+ /**
+ * Gets the node type.
+ *
+ * @return the node type
+ */
+ public String getnode_type() {
+ return node_type;
+ }
+
+ /**
+ * Sets the node type.
+ *
+ * @param node_type the new node type
+ */
+ public void setnode_type(String node_type) {
+ this.node_type = node_type;
+ }
+
+ /**
+ * Gets the capabilities.
+ *
+ * @return the capabilities
+ */
+ public Map<String, Object> getCapabilities() {
+ return capabilities;
+ }
+
+ /**
+ * Sets the capabilities.
+ *
+ * @param capabilities the capabilities
+ */
+ public void setCapabilities(Map<String, Object> capabilities) {
+ this.capabilities = capabilities;
+ }
+
+ /**
+ * Gets the requirements.
+ *
+ * @return the requirements
+ */
+ public Map<String, Object> getRequirements() {
+ return requirements;
+ }
+
+ /**
+ * Sets the requirements.
+ *
+ * @param requirements the requirements
+ */
+ public void setRequirements(Map<String, Object> requirements) {
+ this.requirements = requirements;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
index 25b2c2c38..70830715e 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/TopologyTemplate.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/TopologyTemplate.java
@@ -1,124 +1,124 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * The Class TopologyTemplate.
- */
-public class TopologyTemplate {
-
- /** The substitution mappings. */
- private SubstitutionMappings substitution_mappings;
-
- /** The inputs. */
- private Map<String, Input> inputs;
-
- /** The node templates. */
- private Map<String, NodeTemplate> node_templates;
-
- /** The groups. */
- private Map<String, Group> groups;
-
- /**
- * Instantiates a new topology template.
- */
- public TopologyTemplate() {
- substitution_mappings = new SubstitutionMappings();
- inputs = new HashMap<String, Input> ();
- node_templates = new HashMap<String, NodeTemplate> ();
- groups = new HashMap<String, Group> ();
- }
-
- /**
- * Gets the substitution mappings.
- *
- * @return the substitution mappings
- */
- public SubstitutionMappings getsubstitution_mappings() {
- return this.substitution_mappings;
- }
-
- /**
- * Sets the substitution mappings.
- *
- * @param substitution_mappings the new substitution mappings
- */
- public void setsubstitution_mappings(SubstitutionMappings substitution_mappings) {
- this.substitution_mappings = substitution_mappings;
- }
-
- /**
- * Gets the inputs.
- *
- * @return the inputs
- */
- public Map<String, Input> getInputs() {
- return inputs;
- }
-
- /**
- * Sets the inputs.
- *
- * @param inputs the inputs
- */
- public void setInputs(Map<String, Input> inputs) {
- this.inputs = inputs;
- }
-
- /**
- * Gets the node templates.
- *
- * @return the node templates
- */
- public Map<String, NodeTemplate> getnode_templates() {
- return node_templates;
- }
-
- /**
- * Setnode templates.
- *
- * @param node_templates the node templates
- */
- public void setnode_templates(Map<String, NodeTemplate> node_templates) {
- this.node_templates = node_templates;
- }
-
- /**
- * Gets the groups.
- *
- * @return the groups
- */
- public Map<String, Group> getGroups() {
- return groups;
- }
-
- /**
- * Sets the groups.
- *
- * @param groups the groups
- */
- public void setGroups(Map<String, Group> groups) {
- this.groups = groups;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * The Class TopologyTemplate.
+ */
+public class TopologyTemplate {
+
+ /** The substitution mappings. */
+ private SubstitutionMappings substitution_mappings;
+
+ /** The inputs. */
+ private Map<String, Input> inputs;
+
+ /** The node templates. */
+ private Map<String, NodeTemplate> node_templates;
+
+ /** The groups. */
+ private Map<String, Group> groups;
+
+ /**
+ * Instantiates a new topology template.
+ */
+ public TopologyTemplate() {
+ substitution_mappings = new SubstitutionMappings();
+ inputs = new HashMap<String, Input> ();
+ node_templates = new HashMap<String, NodeTemplate> ();
+ groups = new HashMap<String, Group> ();
+ }
+
+ /**
+ * Gets the substitution mappings.
+ *
+ * @return the substitution mappings
+ */
+ public SubstitutionMappings getsubstitution_mappings() {
+ return this.substitution_mappings;
+ }
+
+ /**
+ * Sets the substitution mappings.
+ *
+ * @param substitution_mappings the new substitution mappings
+ */
+ public void setsubstitution_mappings(SubstitutionMappings substitution_mappings) {
+ this.substitution_mappings = substitution_mappings;
+ }
+
+ /**
+ * Gets the inputs.
+ *
+ * @return the inputs
+ */
+ public Map<String, Input> getInputs() {
+ return inputs;
+ }
+
+ /**
+ * Sets the inputs.
+ *
+ * @param inputs the inputs
+ */
+ public void setInputs(Map<String, Input> inputs) {
+ this.inputs = inputs;
+ }
+
+ /**
+ * Gets the node templates.
+ *
+ * @return the node templates
+ */
+ public Map<String, NodeTemplate> getnode_templates() {
+ return node_templates;
+ }
+
+ /**
+ * Setnode templates.
+ *
+ * @param node_templates the node templates
+ */
+ public void setnode_templates(Map<String, NodeTemplate> node_templates) {
+ this.node_templates = node_templates;
+ }
+
+ /**
+ * Gets the groups.
+ *
+ * @return the groups
+ */
+ public Map<String, Group> getGroups() {
+ return groups;
+ }
+
+ /**
+ * Sets the groups.
+ *
+ * @param groups the groups
+ */
+ public void setGroups(Map<String, Group> groups) {
+ this.groups = groups;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
index 9e9e1d00b..678583573 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaCsar.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaCsar.java
@@ -1,101 +1,101 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.LinkedList;
-
-/**
- * The Class ToscaCsar.
- */
-public class ToscaCsar {
-
- /** The parent. */
- private final ToscaModel parent;
-
- /** The children. */
- private final Collection<ToscaModel> children;
-
- /**
- * The Class Builder.
- */
- public static class Builder {
-
- /** The parent. */
- private final ToscaModel parent;
-
- /** The children. */
- private Collection<ToscaModel> children = new LinkedList<ToscaModel> ();
-
- /**
- * Instantiates a new builder.
- *
- * @param parent the parent
- */
- public Builder(ToscaModel parent) {
- this.parent = parent;
- }
-
- /**
- * Adds the vnf.
- *
- * @param child the child
- * @return the builder
- */
- public Builder addVnf(ToscaModel child) {
- children.add(child);
- return this;
- }
-
- /**
- * Builds the.
- *
- * @return the tosca csar
- */
- public ToscaCsar build() {
- return new ToscaCsar(this);
- }
- }
-
- /**
- * Instantiates a new tosca csar.
- *
- * @param builder the builder
- */
- public ToscaCsar(Builder builder) {
- this.parent = builder.parent;
- this.children = builder.children;
- }
-
- /**
- * Gets the parent.
- *
- * @return the parent
- */
- public ToscaModel getParent() { return parent; }
-
- /**
- * Gets the children.
- *
- * @return the children
- */
- public Collection<ToscaModel> getChildren() { return children; }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.LinkedList;
+
+/**
+ * The Class ToscaCsar.
+ */
+public class ToscaCsar {
+
+ /** The parent. */
+ private final ToscaModel parent;
+
+ /** The children. */
+ private final Collection<ToscaModel> children;
+
+ /**
+ * The Class Builder.
+ */
+ public static class Builder {
+
+ /** The parent. */
+ private final ToscaModel parent;
+
+ /** The children. */
+ private Collection<ToscaModel> children = new LinkedList<ToscaModel> ();
+
+ /**
+ * Instantiates a new builder.
+ *
+ * @param parent the parent
+ */
+ public Builder(ToscaModel parent) {
+ this.parent = parent;
+ }
+
+ /**
+ * Adds the vnf.
+ *
+ * @param child the child
+ * @return the builder
+ */
+ public Builder addVnf(ToscaModel child) {
+ children.add(child);
+ return this;
+ }
+
+ /**
+ * Builds the.
+ *
+ * @return the tosca csar
+ */
+ public ToscaCsar build() {
+ return new ToscaCsar(this);
+ }
+ }
+
+ /**
+ * Instantiates a new tosca csar.
+ *
+ * @param builder the builder
+ */
+ public ToscaCsar(Builder builder) {
+ this.parent = builder.parent;
+ this.children = builder.children;
+ }
+
+ /**
+ * Gets the parent.
+ *
+ * @return the parent
+ */
+ public ToscaModel getParent() { return parent; }
+
+ /**
+ * Gets the children.
+ *
+ * @return the children
+ */
+ public Collection<ToscaModel> getChildren() { return children; }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
index a5295c476..a7a6c6296 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMeta.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMeta.java
@@ -1,124 +1,124 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.openecomp.vid.asdc.AsdcCatalogException;
-
-/**
- * The Class ToscaMeta.
- */
-public class ToscaMeta {
-
- /** The metadata. */
- private final Map<String, String> metadata;
-
- /**
- * Instantiates a new tosca meta.
- *
- * @param builder the builder
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws AsdcCatalogException the asdc catalog exception
- */
- private ToscaMeta(Builder builder) throws IOException, AsdcCatalogException {
- metadata = new HashMap<String, String> ();
-
- read(builder.inputStream);
- }
-
- /**
- * The Class Builder.
- */
- public static class Builder {
-
- /** The input stream. */
- private final InputStream inputStream;
-
- /**
- * Instantiates a new builder.
- *
- * @param inputStream the input stream
- */
- public Builder(InputStream inputStream) {
- this.inputStream = inputStream;
- }
-
- /**
- * Builds the.
- *
- * @return the tosca meta
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws AsdcCatalogException the asdc catalog exception
- */
- public ToscaMeta build() throws IOException, AsdcCatalogException {
- return new ToscaMeta(this);
- }
- }
-
- /**
- * Gets the.
- *
- * @param property the property
- * @return the string
- */
- public String get(String property) {
- return metadata.get(property);
- }
-
- /**
- * Read.
- *
- * @param inputStream the input stream
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws AsdcCatalogException the asdc catalog exception
- */
- private void read(InputStream inputStream) throws IOException, AsdcCatalogException {
-
- final BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
-
- String line;
-
- try {
- while ((line = br.readLine()) != null) {
- if ( line.length() > 0 ) {
- final String[] entry = line.split(":");
-
- if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line");
- if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')");
-
- metadata.put(entry[0], entry[1].substring(1));
- }
- }
- } catch (IOException e) {
- metadata.clear();
- throw e;
- } catch (AsdcCatalogException e) {
- metadata.clear();
- throw e;
- }
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.onap.vid.asdc.AsdcCatalogException;
+
+/**
+ * The Class ToscaMeta.
+ */
+public class ToscaMeta {
+
+ /** The metadata. */
+ private final Map<String, String> metadata;
+
+ /**
+ * Instantiates a new tosca meta.
+ *
+ * @param builder the builder
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ private ToscaMeta(Builder builder) throws IOException, AsdcCatalogException {
+ metadata = new HashMap<String, String> ();
+
+ read(builder.inputStream);
+ }
+
+ /**
+ * The Class Builder.
+ */
+ public static class Builder {
+
+ /** The input stream. */
+ private final InputStream inputStream;
+
+ /**
+ * Instantiates a new builder.
+ *
+ * @param inputStream the input stream
+ */
+ public Builder(InputStream inputStream) {
+ this.inputStream = inputStream;
+ }
+
+ /**
+ * Builds the.
+ *
+ * @return the tosca meta
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ public ToscaMeta build() throws IOException, AsdcCatalogException {
+ return new ToscaMeta(this);
+ }
+ }
+
+ /**
+ * Gets the.
+ *
+ * @param property the property
+ * @return the string
+ */
+ public String get(String property) {
+ return metadata.get(property);
+ }
+
+ /**
+ * Read.
+ *
+ * @param inputStream the input stream
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ private void read(InputStream inputStream) throws IOException, AsdcCatalogException {
+
+ final BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));
+
+ String line;
+
+ try {
+ while ((line = br.readLine()) != null) {
+ if ( line.length() > 0 ) {
+ final String[] entry = line.split(":");
+
+ if (entry.length != 2) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (more than 1 colon found on a single line");
+ if (!entry[1].startsWith(" ")) throw new AsdcCatalogException("TOSCA.meta file cannot be parsed (: not immediately followed by ' ')");
+
+ metadata.put(entry[0], entry[1].substring(1));
+ }
+ }
+ } catch (IOException e) {
+ metadata.clear();
+ throw e;
+ } catch (AsdcCatalogException e) {
+ metadata.clear();
+ throw e;
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
index d42c1f150..32e9fbac6 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaMetadata.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaMetadata.java
@@ -1,461 +1,461 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-/**
- * The Class ToscaMetadata.
- */
-public class ToscaMetadata {
-
- /** The template name. */
- private String template_name;
-
- /** The invariant UUID. */
- private String invariantUUID;
-
- /** The customization UUID. */
- private String customizationUUID;
-
- /** The uuid. */
- private String uuid;
-
- /** The version. */
- private String version;
-
- /** The name. */
- private String name;
-
- /** The description. */
- private String description;
-
- /** The category. */
- private String category;
-
- /** The subcategory. */
- private String subcategory;
-
- /** The type. */
- private String type;
-
- /** The resource vendor. */
- private String resourceVendor;
-
- /** The resource vendor release. */
- private String resourceVendorRelease;
-
- /** The service ecomp naming. */
- private String serviceEcompNaming;
-
- /** The ecomp generated naming - duplicate for serviceEcompNaming */
- private boolean ecompGeneratedNaming;
-
- /** The naming policy */
- private String namingPolicy;
-
- /** The service homing. */
- private boolean serviceHoming;
-
- /** The vf module model name. */
- //ToscaMetadata for VF Modules
- private String vfModuleModelName;
-
- /** The vf module model invariant UUID. */
- private String vfModuleModelInvariantUUID;
-
- /** The vf module model customization UUID. */
- private String vfModuleModelCustomizationUUID;
-
- /** The vf module model UUID. */
- private String vfModuleModelUUID;
-
- /** The vf module model version. */
- private String vfModuleModelVersion;
-
- /**
- * Instantiates a new tosca metadata.
- */
- public ToscaMetadata() {}
-
- /**
- * Gets the type.
- *
- * @return the type
- */
- public String getType() {
- return type;
- }
-
- /**
- * Gets the invariant UUID.
- *
- * @return the invariant UUID
- */
- public String getInvariantUUID() {
- return invariantUUID;
- }
- /**
- * Gets the customization UUID.
- *
- * @return the customization UUID
- */
- public String getCustomizationUUID() {
- return customizationUUID;
- }
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUUID() {
- return uuid;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the category.
- *
- * @return the category
- */
- public String getCategory() {
- return category;
- }
-
- /**
- * Gets the subcategory.
- *
- * @return the subcategory
- */
- public String getSubcategory() {
- return subcategory;
- }
-
- /**
- * Gets the resource vendor.
- *
- * @return the resource vendor
- */
- public String getResourceVendor() {
- return resourceVendor;
- }
-
- /**
- * Gets the resource vendor release.
- *
- * @return the resource vendor release
- */
- public String getResourceVendorRelease() {
- return resourceVendorRelease;
- }
-
- /**
- * Returns the value of service ecomp naming.
- *
- * @return serviceEcompNaming
- */
- public String getServiceEcompNaming() {
- return serviceEcompNaming;
- }
- /**
- * Returns the value of the naming policy.
- *
- * @return namingPolicy
- */
- public String getNamingPolicy() {
- return namingPolicy;
- }
- /**
- * Checks if is service homing.
- *
- * @return true, if is service homing
- */
- public boolean isServiceHoming() {
- return serviceHoming;
- }
- /**
- * Checks if is ecomp generated naming.
- *
- * @return true, if ecomp generated naming is true
- */
- public boolean isEcompGeneratedNaming() {
- return ecompGeneratedNaming;
- }
- /**
- * Sets the type.
- *
- * @param type the new type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * Sets the invariant UUID.
- *
- * @param invariantUUID the new invariant UUID
- */
- public void setInvariantUUID(String invariantUUID) {
- this.invariantUUID = invariantUUID;
- }
- /**
- * Sets the naming policy.
- *
- * @param namingPolicy the new naming policy
- */
- public void setNamingPolicy(String namingPolicy) {
- this.namingPolicy = namingPolicy;
- }
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUUID(String uuid) {
- this.uuid = uuid;
- }
- /**
- * Sets the customization uuid.
- *
- * @param u the new customization uuid
- */
- public void setCustomizationUUID(String u) {
- this.customizationUUID = u;
- }
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the category.
- *
- * @param category the new category
- */
- public void setCategory(String category) {
- this.category = category;
- }
-
- /**
- * Sets the service ecomp naming.
- *
- * @param serviceEcompNaming the new service ecomp naming
- */
- public void setServiceEcompNaming(String serviceEcompNaming) {
- this.serviceEcompNaming = serviceEcompNaming;
- }
-
- /**
- * Sets the service homing.
- *
- * @param serviceHoming the new service homing
- */
- public void setServiceHoming(boolean serviceHoming) {
- this.serviceHoming = serviceHoming;
- }
- /**
- * Sets the ecomp generated naming.
- *
- * @param ecompGeneratedNaming the new ecomp generated naming
- */
- public void setEcompGeneratedNaming(boolean ecompGeneratedNaming) {
- this.ecompGeneratedNaming = ecompGeneratedNaming;
- }
- /**
- * Gets the template name.
- *
- * @return the template name
- */
- public String gettemplate_name() {
- return template_name;
- }
-
- /**
- * Sets the template name.
- *
- * @param template_name the new template name
- */
- public void settemplate_name(String template_name) {
- this.template_name = template_name;
- }
-
- /**
- * Sets the subcategory.
- *
- * @param subcategory the new subcategory
- */
- public void setSubcategory(String subcategory) {
- this.subcategory = subcategory;
- }
-
- /**
- * Sets the resource vendor.
- *
- * @param resourceVendor the new resource vendor
- */
- public void setResourceVendor(String resourceVendor) {
- this.resourceVendor = resourceVendor;
- }
-
- /**
- * Sets the resource vendor release.
- *
- * @param resourceVendorRelease the new resource vendor release
- */
- public void setResourceVendorRelease(String resourceVendorRelease) {
- this.resourceVendorRelease = resourceVendorRelease;
- }
-
- /**
- * Gets the vf module model name.
- *
- * @return the vf module model name
- */
- public String getVfModuleModelName() {
- return vfModuleModelName;
- }
-
- /**
- * Sets the vf module model name.
- *
- * @param vfModuleModelName the new vf module model name
- */
- public void setVfModuleModelName(String vfModuleModelName) {
- this.vfModuleModelName = vfModuleModelName;
- }
-
- /**
- * Gets the vf module model invariant UUID.
- *
- * @return the vf module model invariant UUID
- */
- public String getVfModuleModelInvariantUUID() {
- return vfModuleModelInvariantUUID;
- }
-
- /**
- * Sets the vf module model invariant UUID.
- *
- * @param vfModuleModelInvariantUUID the new vf module model invariant UUID
- */
- public void setVfModuleModelInvariantUUID(String vfModuleModelInvariantUUID) {
- this.vfModuleModelInvariantUUID = vfModuleModelInvariantUUID;
- }
-
- /**
- * Gets the vf module model UUID.
- *
- * @return the vf module model UUID
- */
- public String getVfModuleModelUUID() {
- return vfModuleModelUUID;
- }
-
- /**
- * Sets the vf module model UUID.
- *
- * @param vfModuleModelUUID the new vf module model UUID
- */
- public void setVfModuleModelUUID(String vfModuleModelUUID) {
- this.vfModuleModelUUID = vfModuleModelUUID;
- }
-
- /**
- * Gets the vf module model version.
- *
- * @return the vf module model version
- */
- public String getVfModuleModelVersion() {
- return vfModuleModelVersion;
- }
-
- /**
- * Sets the vf module model version.
- *
- * @param vfModuleModelVersion the new vf module model version
- */
- public void setVfModuleModelVersion(String vfModuleModelVersion) {
- this.vfModuleModelVersion = vfModuleModelVersion;
- }
- /**
- * Sets the vf module customization uuid.
- *
- * @param u the new vf module model customization uuid
- */
- public void setVfModuleModelCustomizationUUID(String u) {
- this.vfModuleModelCustomizationUUID = u;
- }
- /**
- * Gets the vf module model customization uuid.
- *
- * @return the vf module model customization uuid
- */
- public String getVfModuleModelCustomizationUUID() {
-
- return vfModuleModelCustomizationUUID;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+/**
+ * The Class ToscaMetadata.
+ */
+public class ToscaMetadata {
+
+ /** The template name. */
+ private String template_name;
+
+ /** The invariant UUID. */
+ private String invariantUUID;
+
+ /** The customization UUID. */
+ private String customizationUUID;
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The version. */
+ private String version;
+
+ /** The name. */
+ private String name;
+
+ /** The description. */
+ private String description;
+
+ /** The category. */
+ private String category;
+
+ /** The subcategory. */
+ private String subcategory;
+
+ /** The type. */
+ private String type;
+
+ /** The resource vendor. */
+ private String resourceVendor;
+
+ /** The resource vendor release. */
+ private String resourceVendorRelease;
+
+ /** The service ecomp naming. */
+ private String serviceEcompNaming;
+
+ /** The ecomp generated naming - duplicate for serviceEcompNaming */
+ private boolean ecompGeneratedNaming;
+
+ /** The naming policy */
+ private String namingPolicy;
+
+ /** The service homing. */
+ private boolean serviceHoming;
+
+ /** The vf module model name. */
+ //ToscaMetadata for VF Modules
+ private String vfModuleModelName;
+
+ /** The vf module model invariant UUID. */
+ private String vfModuleModelInvariantUUID;
+
+ /** The vf module model customization UUID. */
+ private String vfModuleModelCustomizationUUID;
+
+ /** The vf module model UUID. */
+ private String vfModuleModelUUID;
+
+ /** The vf module model version. */
+ private String vfModuleModelVersion;
+
+ /**
+ * Instantiates a new tosca metadata.
+ */
+ public ToscaMetadata() {}
+
+ /**
+ * Gets the type.
+ *
+ * @return the type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Gets the invariant UUID.
+ *
+ * @return the invariant UUID
+ */
+ public String getInvariantUUID() {
+ return invariantUUID;
+ }
+ /**
+ * Gets the customization UUID.
+ *
+ * @return the customization UUID
+ */
+ public String getCustomizationUUID() {
+ return customizationUUID;
+ }
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUUID() {
+ return uuid;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the category.
+ *
+ * @return the category
+ */
+ public String getCategory() {
+ return category;
+ }
+
+ /**
+ * Gets the subcategory.
+ *
+ * @return the subcategory
+ */
+ public String getSubcategory() {
+ return subcategory;
+ }
+
+ /**
+ * Gets the resource vendor.
+ *
+ * @return the resource vendor
+ */
+ public String getResourceVendor() {
+ return resourceVendor;
+ }
+
+ /**
+ * Gets the resource vendor release.
+ *
+ * @return the resource vendor release
+ */
+ public String getResourceVendorRelease() {
+ return resourceVendorRelease;
+ }
+
+ /**
+ * Returns the value of service ecomp naming.
+ *
+ * @return serviceEcompNaming
+ */
+ public String getServiceEcompNaming() {
+ return serviceEcompNaming;
+ }
+ /**
+ * Returns the value of the naming policy.
+ *
+ * @return namingPolicy
+ */
+ public String getNamingPolicy() {
+ return namingPolicy;
+ }
+ /**
+ * Checks if is service homing.
+ *
+ * @return true, if is service homing
+ */
+ public boolean isServiceHoming() {
+ return serviceHoming;
+ }
+ /**
+ * Checks if is ecomp generated naming.
+ *
+ * @return true, if ecomp generated naming is true
+ */
+ public boolean isEcompGeneratedNaming() {
+ return ecompGeneratedNaming;
+ }
+ /**
+ * Sets the type.
+ *
+ * @param type the new type
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Sets the invariant UUID.
+ *
+ * @param invariantUUID the new invariant UUID
+ */
+ public void setInvariantUUID(String invariantUUID) {
+ this.invariantUUID = invariantUUID;
+ }
+ /**
+ * Sets the naming policy.
+ *
+ * @param namingPolicy the new naming policy
+ */
+ public void setNamingPolicy(String namingPolicy) {
+ this.namingPolicy = namingPolicy;
+ }
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUUID(String uuid) {
+ this.uuid = uuid;
+ }
+ /**
+ * Sets the customization uuid.
+ *
+ * @param u the new customization uuid
+ */
+ public void setCustomizationUUID(String u) {
+ this.customizationUUID = u;
+ }
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the category.
+ *
+ * @param category the new category
+ */
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ /**
+ * Sets the service ecomp naming.
+ *
+ * @param serviceEcompNaming the new service ecomp naming
+ */
+ public void setServiceEcompNaming(String serviceEcompNaming) {
+ this.serviceEcompNaming = serviceEcompNaming;
+ }
+
+ /**
+ * Sets the service homing.
+ *
+ * @param serviceHoming the new service homing
+ */
+ public void setServiceHoming(boolean serviceHoming) {
+ this.serviceHoming = serviceHoming;
+ }
+ /**
+ * Sets the ecomp generated naming.
+ *
+ * @param ecompGeneratedNaming the new ecomp generated naming
+ */
+ public void setEcompGeneratedNaming(boolean ecompGeneratedNaming) {
+ this.ecompGeneratedNaming = ecompGeneratedNaming;
+ }
+ /**
+ * Gets the template name.
+ *
+ * @return the template name
+ */
+ public String gettemplate_name() {
+ return template_name;
+ }
+
+ /**
+ * Sets the template name.
+ *
+ * @param template_name the new template name
+ */
+ public void settemplate_name(String template_name) {
+ this.template_name = template_name;
+ }
+
+ /**
+ * Sets the subcategory.
+ *
+ * @param subcategory the new subcategory
+ */
+ public void setSubcategory(String subcategory) {
+ this.subcategory = subcategory;
+ }
+
+ /**
+ * Sets the resource vendor.
+ *
+ * @param resourceVendor the new resource vendor
+ */
+ public void setResourceVendor(String resourceVendor) {
+ this.resourceVendor = resourceVendor;
+ }
+
+ /**
+ * Sets the resource vendor release.
+ *
+ * @param resourceVendorRelease the new resource vendor release
+ */
+ public void setResourceVendorRelease(String resourceVendorRelease) {
+ this.resourceVendorRelease = resourceVendorRelease;
+ }
+
+ /**
+ * Gets the vf module model name.
+ *
+ * @return the vf module model name
+ */
+ public String getVfModuleModelName() {
+ return vfModuleModelName;
+ }
+
+ /**
+ * Sets the vf module model name.
+ *
+ * @param vfModuleModelName the new vf module model name
+ */
+ public void setVfModuleModelName(String vfModuleModelName) {
+ this.vfModuleModelName = vfModuleModelName;
+ }
+
+ /**
+ * Gets the vf module model invariant UUID.
+ *
+ * @return the vf module model invariant UUID
+ */
+ public String getVfModuleModelInvariantUUID() {
+ return vfModuleModelInvariantUUID;
+ }
+
+ /**
+ * Sets the vf module model invariant UUID.
+ *
+ * @param vfModuleModelInvariantUUID the new vf module model invariant UUID
+ */
+ public void setVfModuleModelInvariantUUID(String vfModuleModelInvariantUUID) {
+ this.vfModuleModelInvariantUUID = vfModuleModelInvariantUUID;
+ }
+
+ /**
+ * Gets the vf module model UUID.
+ *
+ * @return the vf module model UUID
+ */
+ public String getVfModuleModelUUID() {
+ return vfModuleModelUUID;
+ }
+
+ /**
+ * Sets the vf module model UUID.
+ *
+ * @param vfModuleModelUUID the new vf module model UUID
+ */
+ public void setVfModuleModelUUID(String vfModuleModelUUID) {
+ this.vfModuleModelUUID = vfModuleModelUUID;
+ }
+
+ /**
+ * Gets the vf module model version.
+ *
+ * @return the vf module model version
+ */
+ public String getVfModuleModelVersion() {
+ return vfModuleModelVersion;
+ }
+
+ /**
+ * Sets the vf module model version.
+ *
+ * @param vfModuleModelVersion the new vf module model version
+ */
+ public void setVfModuleModelVersion(String vfModuleModelVersion) {
+ this.vfModuleModelVersion = vfModuleModelVersion;
+ }
+ /**
+ * Sets the vf module customization uuid.
+ *
+ * @param u the new vf module model customization uuid
+ */
+ public void setVfModuleModelCustomizationUUID(String u) {
+ this.vfModuleModelCustomizationUUID = u;
+ }
+ /**
+ * Gets the vf module model customization uuid.
+ *
+ * @return the vf module model customization uuid
+ */
+ public String getVfModuleModelCustomizationUUID() {
+
+ return vfModuleModelCustomizationUUID;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
index 77fbe9135..972d366cf 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/beans/tosca/ToscaModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/beans/tosca/ToscaModel.java
@@ -1,166 +1,166 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.beans.tosca;
-
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Map;
-
-/**
- * The Class ToscaModel.
- */
-public class ToscaModel {
-
- /** The tosca definitions version. */
- private String tosca_definitions_version;
-
- /** The description. */
- private String description;
-
- /** The metadata. */
- private ToscaMetadata metadata;
-
- /** The topology template. */
- private TopologyTemplate topology_template;
-
- /** The imports. */
- private Collection<Map<String, Map<String, String>>> imports;
-
- /** The node types. */
- private Map<String, Object> node_types;
-
- /**
- * Instantiates a new tosca model.
- */
- public ToscaModel() {
- metadata = new ToscaMetadata();
- topology_template = new TopologyTemplate();
- imports = new LinkedList<Map<String, Map<String, String>>> ();
- }
-
- /**
- * Gets the metadata.
- *
- * @return the metadata
- */
- public ToscaMetadata getMetadata() {
- return metadata;
- }
-
- /**
- * Sets the metadata.
- *
- * @param metadata the new metadata
- */
- public void setMetadata(ToscaMetadata metadata) {
- this.metadata = metadata;
- }
-
- /**
- * Gets the tosca definitions version.
- *
- * @return the tosca definitions version
- */
- public String gettosca_definitions_version() {
- return tosca_definitions_version;
- }
-
- /**
- * Sets the tosca definitions version.
- *
- * @param tosca_definitions_version the new tosca definitions version
- */
- public void settosca_definitions_version(String tosca_definitions_version) {
- this.tosca_definitions_version = tosca_definitions_version;
- }
-
- /**
- * Gets the topology template.
- *
- * @return the topology template
- */
- public TopologyTemplate gettopology_template() {
- return topology_template;
- }
-
- /**
- * Sets the topology template.
- *
- * @param topology_template the new topology template
- */
- public void settopology_template(TopologyTemplate topology_template) {
- this.topology_template = topology_template;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Gets the imports.
- *
- * @return the imports
- */
- public Collection<Map<String, Map<String, String>>> getImports() {
- return imports;
- }
-
- /**
- * Sets the imports.
- *
- * @param imports the imports
- */
- public void setImports(Collection<Map<String, Map<String, String>>> imports) {
- this.imports = imports;
- }
-
- /**
- * Gets the node types.
- *
- * @return the node types
- */
- public Map<String, Object> getnode_types() {
- return node_types;
- }
-
- /**
- * Setnode types.
- *
- * @param node_types the node types
- */
- public void setnode_types(Map<String, Object> node_types) {
- this.node_types = node_types;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.beans.tosca;
+
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+
+/**
+ * The Class ToscaModel.
+ */
+public class ToscaModel {
+
+ /** The tosca definitions version. */
+ private String tosca_definitions_version;
+
+ /** The description. */
+ private String description;
+
+ /** The metadata. */
+ private ToscaMetadata metadata;
+
+ /** The topology template. */
+ private TopologyTemplate topology_template;
+
+ /** The imports. */
+ private Collection<Map<String, Map<String, String>>> imports;
+
+ /** The node types. */
+ private Map<String, Object> node_types;
+
+ /**
+ * Instantiates a new tosca model.
+ */
+ public ToscaModel() {
+ metadata = new ToscaMetadata();
+ topology_template = new TopologyTemplate();
+ imports = new LinkedList<Map<String, Map<String, String>>> ();
+ }
+
+ /**
+ * Gets the metadata.
+ *
+ * @return the metadata
+ */
+ public ToscaMetadata getMetadata() {
+ return metadata;
+ }
+
+ /**
+ * Sets the metadata.
+ *
+ * @param metadata the new metadata
+ */
+ public void setMetadata(ToscaMetadata metadata) {
+ this.metadata = metadata;
+ }
+
+ /**
+ * Gets the tosca definitions version.
+ *
+ * @return the tosca definitions version
+ */
+ public String gettosca_definitions_version() {
+ return tosca_definitions_version;
+ }
+
+ /**
+ * Sets the tosca definitions version.
+ *
+ * @param tosca_definitions_version the new tosca definitions version
+ */
+ public void settosca_definitions_version(String tosca_definitions_version) {
+ this.tosca_definitions_version = tosca_definitions_version;
+ }
+
+ /**
+ * Gets the topology template.
+ *
+ * @return the topology template
+ */
+ public TopologyTemplate gettopology_template() {
+ return topology_template;
+ }
+
+ /**
+ * Sets the topology template.
+ *
+ * @param topology_template the new topology template
+ */
+ public void settopology_template(TopologyTemplate topology_template) {
+ this.topology_template = topology_template;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Gets the imports.
+ *
+ * @return the imports
+ */
+ public Collection<Map<String, Map<String, String>>> getImports() {
+ return imports;
+ }
+
+ /**
+ * Sets the imports.
+ *
+ * @param imports the imports
+ */
+ public void setImports(Collection<Map<String, Map<String, String>>> imports) {
+ this.imports = imports;
+ }
+
+ /**
+ * Gets the node types.
+ *
+ * @return the node types
+ */
+ public Map<String, Object> getnode_types() {
+ return node_types;
+ }
+
+ /**
+ * Setnode types.
+ *
+ * @param node_types the node types
+ */
+ public void setnode_types(Map<String, Object> node_types) {
+ this.node_types = node_types;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
index 696e18904..3c04e5ce8 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/local/LocalAsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/local/LocalAsdcClient.java
@@ -1,18 +1,18 @@
-package org.openecomp.vid.asdc.local;
+package org.onap.vid.asdc.local;
import org.codehaus.jackson.JsonParseException;
import org.codehaus.jackson.map.JsonMappingException;
import org.codehaus.jackson.map.ObjectMapper;
import org.json.JSONArray;
import org.json.JSONObject;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.tosca.ToscaMeta;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.tosca.ToscaMeta;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
import org.yaml.snakeyaml.Yaml;
import java.io.File;
@@ -22,7 +22,10 @@ import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
-import java.util.*;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.UUID;
import java.util.zip.ZipFile;
/**
@@ -42,66 +45,11 @@ public class LocalAsdcClient implements AsdcClient {
private final ObjectMapper mapper;
/**
- * The Class Builder.
- */
- public static class Builder {
-
- /**
- * The catalog.
- */
- private JSONObject catalog = new JSONObject()
- .put("resources", new JSONObject())
- .put("services", new JSONObject());
-
- /**
- * The mapper.
- */
- private ObjectMapper mapper = new ObjectMapper();
-
- /**
- * Instantiates a new builder.
- */
- public Builder() {
- }
-
- /**
- * Catalog.
- *
- * @param catalog the catalog
- * @return the builder
- */
- public org.openecomp.vid.asdc.local.LocalAsdcClient.Builder catalog(JSONObject catalog) {
- this.catalog = catalog;
- return this;
- }
-
- /**
- * Mapper.
- *
- * @param mapper the mapper
- * @return the builder
- */
- public org.openecomp.vid.asdc.local.LocalAsdcClient.Builder mapper(ObjectMapper mapper) {
- this.mapper = mapper;
- return this;
- }
-
- /**
- * Builds the.
- *
- * @return the in local sdc client
- */
- public org.openecomp.vid.asdc.local.LocalAsdcClient build() {
- return new org.openecomp.vid.asdc.local.LocalAsdcClient(this);
- }
- }
-
- /**
* Instantiates a new in local sdc client.
*
* @param builder the builder
*/
- private LocalAsdcClient(org.openecomp.vid.asdc.local.LocalAsdcClient.Builder builder) {
+ public LocalAsdcClient(org.onap.vid.asdc.local.LocalAsdcClient.Builder builder) {
catalog = builder.catalog;
mapper = builder.mapper;
}
@@ -203,7 +151,7 @@ public class LocalAsdcClient implements AsdcClient {
JSONObject serviceJsonObject = null;
final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
- for (int i = 0; i < categoryJsonArray.length() ; i++) {
+ for (int i = 0; i < categoryJsonArray.length(); i++) {
JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
if (jsonServiceObject.get("uuid").equals(uuid.toString())) {
serviceJsonObject = jsonServiceObject;
@@ -264,7 +212,7 @@ public class LocalAsdcClient implements AsdcClient {
* @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
*/
public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
- final JSONArray artifacts = getCatalog().getJSONObject("resources")
+ final JSONArray artifacts = getCatalog().getJSONObject("resources")
.getJSONObject(resourceUuid.toString())
.getJSONArray("artifacts");
@@ -323,7 +271,7 @@ public class LocalAsdcClient implements AsdcClient {
final JSONArray categoryJsonArray = getCatalog().getJSONArray("services");
- for (int i = 0; i < categoryJsonArray.length() ; i++) {
+ for (int i = 0; i < categoryJsonArray.length(); i++) {
JSONObject jsonServiceObject = categoryJsonArray.getJSONObject(i);
if (jsonServiceObject.get("uuid").equals(serviceUuid.toString())) {
@@ -331,11 +279,9 @@ public class LocalAsdcClient implements AsdcClient {
break;
}
}
-
- if (toscaModelURL==null){
+ if (toscaModelURL == null) {
return null;
}
-
final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
ClassLoader classLoader = getClass().getClassLoader();
@@ -390,4 +336,59 @@ public class LocalAsdcClient implements AsdcClient {
}
}
+ /**
+ * The Class Builder.
+ */
+ public static class Builder {
+
+ /**
+ * The catalog.
+ */
+ private JSONObject catalog = new JSONObject()
+ .put("resources", new JSONObject())
+ .put("services", new JSONObject());
+
+ /**
+ * The mapper.
+ */
+ private ObjectMapper mapper = new ObjectMapper();
+
+ /**
+ * Instantiates a new builder.
+ */
+ public Builder() {
+ }
+
+ /**
+ * Catalog.
+ *
+ * @param catalog the catalog
+ * @return the builder
+ */
+ public org.onap.vid.asdc.local.LocalAsdcClient.Builder catalog(JSONObject catalog) {
+ this.catalog = catalog;
+ return this;
+ }
+
+ /**
+ * Mapper.
+ *
+ * @param mapper the mapper
+ * @return the builder
+ */
+ public org.onap.vid.asdc.local.LocalAsdcClient.Builder mapper(ObjectMapper mapper) {
+ this.mapper = mapper;
+ return this;
+ }
+
+ /**
+ * Builds the.
+ *
+ * @return the in local sdc client
+ */
+ public org.onap.vid.asdc.local.LocalAsdcClient build() {
+ return new org.onap.vid.asdc.local.LocalAsdcClient(this);
+ }
+ }
+
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
index 2b783d45a..a7b934e99 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/memory/InMemoryAsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/memory/InMemoryAsdcClient.java
@@ -1,372 +1,372 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.memory;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.util.Collection;
-import java.util.LinkedList;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.UUID;
-import java.util.zip.ZipFile;
-
-import org.codehaus.jackson.JsonParseException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.json.JSONArray;
-import org.json.JSONObject;
-import org.yaml.snakeyaml.Yaml;
-
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.tosca.ToscaMeta;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-
-/**
- * The Class InMemoryAsdcClient.
- */
-public class InMemoryAsdcClient implements AsdcClient {
-
- /** The catalog. */
- private final JSONObject catalog;
-
- /** The mapper. */
- private final ObjectMapper mapper;
-
- /**
- * The Class Builder.
- */
- public static class Builder {
-
- /** The catalog. */
- private JSONObject catalog = new JSONObject()
- .put("resources", new JSONObject())
- .put("services", new JSONObject());
-
- /** The mapper. */
- private ObjectMapper mapper = new ObjectMapper();
-
- /**
- * Instantiates a new builder.
- */
- public Builder() {}
-
- /**
- * Catalog.
- *
- * @param catalog the catalog
- * @return the builder
- */
- public Builder catalog(JSONObject catalog) {
- this.catalog = catalog;
- return this;
- }
-
- /**
- * Mapper.
- *
- * @param mapper the mapper
- * @return the builder
- */
- public Builder mapper(ObjectMapper mapper) {
- this.mapper = mapper;
- return this;
- }
-
- /**
- * Builds the.
- *
- * @return the in memory sdc client
- */
- public InMemoryAsdcClient build() {
- return new InMemoryAsdcClient(this);
- }
- }
-
- /**
- * Instantiates a new in memory sdc client.
- *
- * @param builder the builder
- */
- InMemoryAsdcClient(Builder builder) {
- catalog = builder.catalog;
- mapper = builder.mapper;
- }
-
- /**
- * Gets the catalog.
- *
- * @return the catalog
- */
- private JSONObject getCatalog() {
- return catalog;
- }
-
- /**
- * Gets the mapper.
- *
- * @return the mapper
- */
- private ObjectMapper getMapper() {
- return mapper;
- }
-
- /**
- * Convert.
- *
- * @param <T> the generic type
- * @param json the json
- * @param clazz the clazz
- * @return the t
- * @throws AsdcCatalogException the sdc catalog exception
- */
- private <T> T convert(JSONObject json, Class<T> clazz) throws AsdcCatalogException {
- try {
- return getMapper().readValue(json.toString(), clazz);
- } catch (JsonParseException e) {
- throw new AsdcCatalogException("Failed to parse SDC response (bad data)", e);
- } catch (JsonMappingException e) {
- throw new AsdcCatalogException("Failed to map SDC response to internal VID data structure(s)", e);
- } catch (IOException e) {
- throw new AsdcCatalogException("Failed to get a response from SDC", e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
- */
- public Resource getResource(UUID uuid) throws AsdcCatalogException {
- final JSONObject resource = getCatalog().getJSONObject("resources")
- .getJSONObject(uuid.toString());
- return convert(resource, Resource.class);
- }
-
- /* (non-Javadoc)
- */
- public Collection<Resource> getResources() throws AsdcCatalogException {
- final Collection<Resource> resources = new LinkedList<Resource> ();
-
- for (String key : getCatalog().getJSONObject("resources").keySet()) {
- final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
- final Resource resource = convert(json, Resource.class);
- resources.add(resource);
- }
-
- return resources;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
- */
- public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
- final Collection<Resource> resources = new LinkedList<Resource> ();
-
- for (String key : getCatalog().getJSONObject("resources").keySet()) {
- final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
-
- boolean filterMatch = true;
-
- for (Entry<String, String[]> entry : filter.entrySet()) {
- for (int i = 0; i < entry.getValue().length; i++) {
- if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
- filterMatch = false;
- break;
- }
- }
- }
-
- if (filterMatch) resources.add(convert(json, Resource.class));
- }
-
- return resources;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
- */
- public Service getService(UUID uuid) throws AsdcCatalogException {
- final JSONObject service = getCatalog().getJSONObject("services")
- .getJSONObject(uuid.toString());
- return convert(service, Service.class);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServices()
- */
- public Collection<Service> getServices() throws AsdcCatalogException {
- final Collection<Service> services = new LinkedList<Service> ();
-
- for (String key : getCatalog().getJSONObject("services").keySet()) {
- final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
- final Service service = convert(json, Service.class);
- services.add(service);
- }
-
- return services;
- }
-
- /* (non-Javadoc)
- * @see org.openecompt.vid.asdc.AsdcClient#getServices(java.util.Map)
- */
- public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
- final Collection<Service> services = new LinkedList<Service> ();
-
- for (String key : getCatalog().getJSONObject("services").keySet()) {
- final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
-
- boolean filterMatch = true;
-
- for (Entry<String, String[]> entry : filter.entrySet()) {
- for (int i = 0; i < entry.getValue().length; i++) {
- if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
- filterMatch = false;
- break;
- }
- }
- }
-
- if (filterMatch) services.add(convert(json, Service.class));
- }
-
- return services;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
- */
- public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
- final JSONArray artifacts = getCatalog().getJSONObject("resources")
- .getJSONObject(resourceUuid.toString())
- .getJSONArray("artifacts");
-
- for (int i = 0; i < artifacts.length(); i++) {
- final JSONObject artifact = artifacts.getJSONObject(i);
-
- if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
- return convert(artifact, Artifact.class);
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
- */
- public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
- final JSONArray artifacts = getCatalog().getJSONObject("services")
- .getJSONObject(serviceUuid.toString())
- .getJSONArray("artifacts");
-
- for (int i = 0; i < artifacts.length(); i++) {
- final JSONObject artifact = artifacts.getJSONObject(i);
-
- if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
- return convert(artifact, Artifact.class);
- }
- }
-
- return null;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
- */
- public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
- final String toscaModelURL = getCatalog().getJSONObject("resources")
- .getJSONObject(resourceUuid.toString())
- .getString("toscaModelURL");
-
-
- final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
-
- if (toscaModelStream == null) return null;
-
- return null;//getToscaModel(toscaModelStream);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
- */
- public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
- final String toscaModelURL = getCatalog().getJSONObject("services")
- .getJSONObject(serviceUuid.toString())
- .getString("toscaModelURL");
-
- final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
-
- if (toscaModelStream == null) return null;
-
- return null;//getToscaModel(toscaModelStream);
- }
-
- /**
- * Gets the tosca model.
- *
- * @param csarInputStream the csar input stream
- * @return the tosca model
- * @throws AsdcCatalogException the asdc catalog exception
- */
- private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException {
- final Path csarFile;
-
- try {
- csarFile = Files.createTempFile("csar", ".zip");
- Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
- } catch (IOException e) {
- throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
- }
-
- try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
-
- final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
- final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
- final String entryDefinitions = toscaMeta.get("Entry-Definitions");
- final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
-
- final Yaml yaml = new Yaml();
- final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
-
- final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
-
- for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
- for (Entry<String, Map<String, String>> entry : imports.entrySet()) {
- final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file")));
- final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
- csarBuilder.addVnf(childModel);
- }
- }
-
- return csarBuilder.build();
- } catch (IOException e) {
- throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
- }
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.memory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.util.Collection;
+import java.util.LinkedList;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+import java.util.zip.ZipFile;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.json.JSONArray;
+import org.json.JSONObject;
+import org.yaml.snakeyaml.Yaml;
+
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.tosca.ToscaMeta;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+
+/**
+ * The Class InMemoryAsdcClient.
+ */
+public class InMemoryAsdcClient implements AsdcClient {
+
+ /** The catalog. */
+ private final JSONObject catalog;
+
+ /** The mapper. */
+ private final ObjectMapper mapper;
+
+ /**
+ * The Class Builder.
+ */
+ public static class Builder {
+
+ /** The catalog. */
+ private JSONObject catalog = new JSONObject()
+ .put("resources", new JSONObject())
+ .put("services", new JSONObject());
+
+ /** The mapper. */
+ private ObjectMapper mapper = new ObjectMapper();
+
+ /**
+ * Instantiates a new builder.
+ */
+ public Builder() {}
+
+ /**
+ * Catalog.
+ *
+ * @param catalog the catalog
+ * @return the builder
+ */
+ public Builder catalog(JSONObject catalog) {
+ this.catalog = catalog;
+ return this;
+ }
+
+ /**
+ * Mapper.
+ *
+ * @param mapper the mapper
+ * @return the builder
+ */
+ public Builder mapper(ObjectMapper mapper) {
+ this.mapper = mapper;
+ return this;
+ }
+
+ /**
+ * Builds the.
+ *
+ * @return the in memory sdc client
+ */
+ public InMemoryAsdcClient build() {
+ return new InMemoryAsdcClient(this);
+ }
+ }
+
+ /**
+ * Instantiates a new in memory sdc client.
+ *
+ * @param builder the builder
+ */
+ private InMemoryAsdcClient(Builder builder) {
+ catalog = builder.catalog;
+ mapper = builder.mapper;
+ }
+
+ /**
+ * Gets the catalog.
+ *
+ * @return the catalog
+ */
+ private JSONObject getCatalog() {
+ return catalog;
+ }
+
+ /**
+ * Gets the mapper.
+ *
+ * @return the mapper
+ */
+ private ObjectMapper getMapper() {
+ return mapper;
+ }
+
+ /**
+ * Convert.
+ *
+ * @param <T> the generic type
+ * @param json the json
+ * @param clazz the clazz
+ * @return the t
+ * @throws AsdcCatalogException the sdc catalog exception
+ */
+ private <T> T convert(JSONObject json, Class<T> clazz) throws AsdcCatalogException {
+ try {
+ return getMapper().readValue(json.toString(), clazz);
+ } catch (JsonParseException e) {
+ throw new AsdcCatalogException("Failed to parse SDC response (bad data)", e);
+ } catch (JsonMappingException e) {
+ throw new AsdcCatalogException("Failed to map SDC response to internal VID data structure(s)", e);
+ } catch (IOException e) {
+ throw new AsdcCatalogException("Failed to get a response from SDC", e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
+ */
+ public Resource getResource(UUID uuid) throws AsdcCatalogException {
+ final JSONObject resource = getCatalog().getJSONObject("resources")
+ .getJSONObject(uuid.toString());
+ return convert(resource, Resource.class);
+ }
+
+ /* (non-Javadoc)
+ */
+ public Collection<Resource> getResources() throws AsdcCatalogException {
+ final Collection<Resource> resources = new LinkedList<Resource> ();
+
+ for (String key : getCatalog().getJSONObject("resources").keySet()) {
+ final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
+ final Resource resource = convert(json, Resource.class);
+ resources.add(resource);
+ }
+
+ return resources;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
+ */
+ public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
+ final Collection<Resource> resources = new LinkedList<Resource> ();
+
+ for (String key : getCatalog().getJSONObject("resources").keySet()) {
+ final JSONObject json = getCatalog().getJSONObject("resources").getJSONObject(key);
+
+ boolean filterMatch = true;
+
+ for (Entry<String, String[]> entry : filter.entrySet()) {
+ for (int i = 0; i < entry.getValue().length; i++) {
+ if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
+ filterMatch = false;
+ break;
+ }
+ }
+ }
+
+ if (filterMatch) resources.add(convert(json, Resource.class));
+ }
+
+ return resources;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
+ */
+ public Service getService(UUID uuid) throws AsdcCatalogException {
+ final JSONObject service = getCatalog().getJSONObject("services")
+ .getJSONObject(uuid.toString());
+ return convert(service, Service.class);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getServices()
+ */
+ public Collection<Service> getServices() throws AsdcCatalogException {
+ final Collection<Service> services = new LinkedList<Service> ();
+
+ for (String key : getCatalog().getJSONObject("services").keySet()) {
+ final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
+ final Service service = convert(json, Service.class);
+ services.add(service);
+ }
+
+ return services;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecompt.vid.asdc.AsdcClient#getServices(java.util.Map)
+ */
+ public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
+ final Collection<Service> services = new LinkedList<Service> ();
+
+ for (String key : getCatalog().getJSONObject("services").keySet()) {
+ final JSONObject json = getCatalog().getJSONObject("services").getJSONObject(key);
+
+ boolean filterMatch = true;
+
+ for (Entry<String, String[]> entry : filter.entrySet()) {
+ for (int i = 0; i < entry.getValue().length; i++) {
+ if (!json.getString(entry.getKey()).equals(entry.getValue()[i])) {
+ filterMatch = false;
+ break;
+ }
+ }
+ }
+
+ if (filterMatch) services.add(convert(json, Service.class));
+ }
+
+ return services;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
+ */
+ public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
+ final JSONArray artifacts = getCatalog().getJSONObject("resources")
+ .getJSONObject(resourceUuid.toString())
+ .getJSONArray("artifacts");
+
+ for (int i = 0; i < artifacts.length(); i++) {
+ final JSONObject artifact = artifacts.getJSONObject(i);
+
+ if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
+ return convert(artifact, Artifact.class);
+ }
+ }
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
+ */
+ public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
+ final JSONArray artifacts = getCatalog().getJSONObject("services")
+ .getJSONObject(serviceUuid.toString())
+ .getJSONArray("artifacts");
+
+ for (int i = 0; i < artifacts.length(); i++) {
+ final JSONObject artifact = artifacts.getJSONObject(i);
+
+ if (artifact.getString("artifactUUID").equals(artifactUuid.toString())) {
+ return convert(artifact, Artifact.class);
+ }
+ }
+
+ return null;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
+ */
+ public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
+ final String toscaModelURL = getCatalog().getJSONObject("resources")
+ .getJSONObject(resourceUuid.toString())
+ .getString("toscaModelURL");
+
+
+ final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
+
+ if (toscaModelStream == null) return null;
+
+ return null;//getToscaModel(toscaModelStream);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
+ */
+ public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
+ final String toscaModelURL = getCatalog().getJSONObject("services")
+ .getJSONObject(serviceUuid.toString())
+ .getString("toscaModelURL");
+
+ final InputStream toscaModelStream = getClass().getClassLoader().getResourceAsStream(toscaModelURL);
+
+ if (toscaModelStream == null) return null;
+
+ return null;//getToscaModel(toscaModelStream);
+ }
+
+ /**
+ * Gets the tosca model.
+ *
+ * @param csarInputStream the csar input stream
+ * @return the tosca model
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ private ToscaCsar getToscaModel(InputStream csarInputStream) throws AsdcCatalogException {
+ final Path csarFile;
+
+ try {
+ csarFile = Files.createTempFile("csar", ".zip");
+ Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
+ } catch (IOException e) {
+ throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
+ }
+
+ try (final ZipFile csar = new ZipFile(csarFile.toFile())) {
+
+ final InputStream toscaMetaStream = csar.getInputStream(csar.getEntry("TOSCA-Metadata/TOSCA.meta"));
+ final ToscaMeta toscaMeta = new ToscaMeta.Builder(toscaMetaStream).build();
+ final String entryDefinitions = toscaMeta.get("Entry-Definitions");
+ final InputStream toscaParentEntryYamlStream = csar.getInputStream(csar.getEntry(entryDefinitions));
+
+ final Yaml yaml = new Yaml();
+ final ToscaModel parentModel = yaml.loadAs(toscaParentEntryYamlStream, ToscaModel.class);
+
+ final ToscaCsar.Builder csarBuilder = new ToscaCsar.Builder(parentModel);
+
+ for (Map<String, Map<String, String>> imports : parentModel.getImports()) {
+ for (Entry<String, Map<String, String>> entry : imports.entrySet()) {
+ final InputStream toscaChildEntryYamlStream = csar.getInputStream(csar.getEntry("Definitions/" + entry.getValue().get("file")));
+ final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
+ csarBuilder.addVnf(childModel);
+ }
+ }
+
+ return csarBuilder.build();
+ } catch (IOException e) {
+ throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
+ }
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParser.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParser.java
index eb1669846..890752afe 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParser.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParser.java
@@ -1,12 +1,12 @@
-package org.openecomp.vid.asdc.parser;
+package org.onap.vid.asdc.parser;
import java.nio.file.Path;
import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.model.ServiceModel;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceModel;
public interface ToscaParser{
ToscaCsar parse(Path path) throws AsdcCatalogException;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
index bea5da877..12881b64f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.asdc.parser;
+package org.onap.vid.asdc.parser;
import java.io.IOException;
import java.io.InputStream;
@@ -13,20 +13,21 @@ import java.util.UUID;
import java.util.Map.Entry;
import java.util.zip.ZipFile;
+import org.apache.commons.lang3.mutable.MutableBoolean;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-import org.openecomp.vid.asdc.beans.tosca.ToscaCsar;
-import org.openecomp.vid.asdc.beans.tosca.ToscaMeta;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.openecomp.vid.model.ModelConstants;
-import org.openecomp.vid.model.Network;
-import org.openecomp.vid.model.Node;
-import org.openecomp.vid.model.ServiceModel;
-import org.openecomp.vid.model.VNF;
-import org.openecomp.vid.properties.VidProperties;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.ToscaCsar;
+import org.onap.vid.asdc.beans.tosca.ToscaMeta;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.model.Network;
+import org.onap.vid.model.Node;
+import org.onap.vid.model.ServiceModel;
+import org.onap.vid.model.VNF;
+import org.onap.vid.properties.VidProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.yaml.snakeyaml.Yaml;
import org.yaml.snakeyaml.error.YAMLException;
@@ -44,7 +45,7 @@ public class ToscaParserImpl implements ToscaParser {
private static final String networkTag = asdcModelNamespace + ModelConstants.NETWORK;
private static final String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
-
+
@Override
public ToscaCsar parse(Path path) throws AsdcCatalogException {
return getToscaCsar(path);
@@ -73,7 +74,7 @@ public class ToscaParserImpl implements ToscaParser {
LOG.debug("fname = " + fname);
final InputStream toscaChildEntryYamlStream = csar
.getInputStream(csar.getEntry("Definitions/" + fname));
-
+
final ToscaModel childModel = yaml.loadAs(toscaChildEntryYamlStream, ToscaModel.class);
csarBuilder.addVnf(childModel);
}
@@ -89,15 +90,15 @@ public class ToscaParserImpl implements ToscaParser {
throw new AsdcCatalogException("Caught IOException while processing CSAR", e);
}
}
-
+
public ServiceModel makeServiceModel(String uuid, final Path serviceCsar,Service service ) throws AsdcCatalogException, SdcToscaParserException {
-
-
+
+
final ServiceModel serviceModel = new ServiceModel();
ToscaCsar toscaCsar = getToscaCsar(serviceCsar);
String methodName = "getServices";
LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
- Boolean isNewFlow = false;
+ MutableBoolean isNewFlow = new MutableBoolean(false);
final Map<String, VNF> vnfs = new HashMap<String, VNF>();
final Map<String, Network> networks = new HashMap<String, Network>();
final ToscaModel asdcServiceToscaModel = toscaCsar.getParent();
@@ -107,7 +108,7 @@ public class ToscaParserImpl implements ToscaParser {
populateVnfsAndNetwork(methodName, isNewFlow, vnfs, networks, asdcServiceToscaModel, serviceModel);
// If we see customization uuid under vnf or network, follow 1702 flow
- if (isNewFlow) {
+ if (isNewFlow.getValue()) {
return (getCustomizedServices(asdcServiceToscaModel, serviceModel));
} else {
VNF vnf = null;
@@ -145,9 +146,9 @@ public class ToscaParserImpl implements ToscaParser {
vnf.setInputs(vnfModel.gettopology_template().getInputs());
}
- private static void populateVnfsAndNetwork(String methodName, Boolean isNewFlow, final Map<String, VNF> vnfs,
- final Map<String, Network> networks, final ToscaModel asdcServiceToscaModel, ServiceModel serviceModel)
- throws AsdcCatalogException, SdcToscaParserException {
+ private static void populateVnfsAndNetwork(String methodName, MutableBoolean isNewFlow, final Map<String, VNF> vnfs,
+ final Map<String, Network> networks, final ToscaModel asdcServiceToscaModel, ServiceModel serviceModel)
+ throws AsdcCatalogException, SdcToscaParserException {
for (Entry<String, NodeTemplate> component : extractNodeTemplates(asdcServiceToscaModel)) {
final String modelCustomizationName = component.getKey();
LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName
@@ -164,7 +165,7 @@ public class ToscaParserImpl implements ToscaParser {
LOG.debug(EELFLoggerDelegate.debugLogger,
dateFormat.format(new Date()) + methodName + " VNF commands: " + vnf.getCommands());
vnfs.put(modelCustomizationName, vnf);
- isNewFlow = isNewFlow(vnf);
+ isNewFlow.setValue(isNewFlow(vnf));
}
// Networks
if (type.startsWith(networkTag)) {
@@ -173,7 +174,7 @@ public class ToscaParserImpl implements ToscaParser {
final Network network = new Network();
network.extractNetwork(modelCustomizationName, nodeTemplate);
// populateNodeVersionIfMissing(nodeTemplate, network, service);
- isNewFlow = isNewFlow(network);
+ isNewFlow.setValue(isNewFlow(network));
networks.put(modelCustomizationName, network);
}
@@ -201,7 +202,7 @@ public class ToscaParserImpl implements ToscaParser {
node.setVersion(service.getVersion());
}
}
-
+
private ServiceModel getCustomizedServices(ToscaModel asdcServiceToscaModel, ServiceModel serviceModel) {
String methodName = "asdcServiceToscaModel";
LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java
index f364d0b3d..4a5ab3af3 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/parser/ToscaParserImpl2.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/parser/ToscaParserImpl2.java
@@ -1,20 +1,20 @@
-package org.openecomp.vid.asdc.parser;
+package org.onap.vid.asdc.parser;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.*;
import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper;
import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
import org.openecomp.sdc.tosca.parser.impl.FilterType;
import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory;
-import org.openecomp.sdc.toscaparser.api.Group;
-import org.openecomp.sdc.toscaparser.api.NodeTemplate;
-import org.openecomp.sdc.toscaparser.api.Property;
+import org.openecomp.sdc.tosca.parser.impl.SdcTypes;
+import org.openecomp.sdc.toscaparser.api.*;
import org.openecomp.sdc.toscaparser.api.parameters.Input;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.model.*;
import java.nio.file.Path;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import static java.util.stream.Collectors.toMap;
public class ToscaParserImpl2 {
@@ -38,26 +38,39 @@ public class ToscaParserImpl2 {
public final static String category = "category";
public final static String vfModuleModelName = "vfModuleModelName";
public final static String getInput = "get_input";
+
+ public final static String instantiationType = "instantiationType";
+ //Instantiation Types
+ public final static String both = "Both";
+ public final static String macro = "Macro";
+ public final static String aLaCarte = "A-La-Carte";
+ public final static String clientConfig = "ClientConfig";
+
+
}
public ToscaParserImpl2() {
}
- public ServiceModel makeServiceModel(Path path, Service asdcServiceMetadata) throws Exception {
+ public ServiceModel makeServiceModel(Path path, Service asdcServiceMetadata) throws Exception {
ServiceModel serviceModel = new ServiceModel();
SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance();
- ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(path.toFile().getAbsolutePath()); //, false);
+ ISdcCsarHelper sdcCsarHelper = factory.getSdcCsarHelper(path.toFile().getAbsolutePath(),false);
serviceModel.setService(extractServiceFromCsar(asdcServiceMetadata, sdcCsarHelper));
+
serviceModel.setVolumeGroups(extractVolumeGroups(sdcCsarHelper));
serviceModel.setVfModules(extractVfModuleFromCsar(sdcCsarHelper));
serviceModel.setVnfs(extractVnfsFromCsar(serviceModel,sdcCsarHelper));
+ serviceModel.setConfigurations(extractPortMirroringConfigFromCsar(sdcCsarHelper));
+ serviceModel.setServiceProxies(extractServiceProxyFromCsar(sdcCsarHelper));
serviceModel.setNetworks(extractNetworksFromCsar(sdcCsarHelper));
+ serviceModel.setPnfs(extractPnfsFromCsar(sdcCsarHelper));
return serviceModel;
}
- private org.openecomp.vid.model.Service extractServiceFromCsar(Service asdcServiceMetadata, ISdcCsarHelper csarHelper) throws SdcToscaParserException {
- org.openecomp.vid.model.Service service = new org.openecomp.vid.model.Service();
+ private org.onap.vid.model.Service extractServiceFromCsar(Service asdcServiceMetadata, ISdcCsarHelper csarHelper) throws SdcToscaParserException {
+ org.onap.vid.model.Service service = new org.onap.vid.model.Service();
service.setName(csarHelper.getServiceMetadata().getValue(Constants.name));
service.setCategory(csarHelper.getServiceMetadata().getValue(Constants.category));
@@ -69,9 +82,10 @@ public class ToscaParserImpl2 {
service.setServiceEcompNaming(csarHelper.getServiceMetadata().getValue(Constants.ecompGeneratedNaming));
service.setServiceType(csarHelper.getServiceMetadata().getValue(Constants.serviceType));
service.setServiceRole(csarHelper.getServiceMetadata().getValue(Constants.serviceRole));
-
+ service.setInstantiationType(validateInstantiationType(csarHelper));
return service;
}
+
private Map<String, VNF> extractVnfsFromCsar(ServiceModel serviceModel,ISdcCsarHelper csarHelper) {
List<NodeTemplate> nodeTemplates = csarHelper.getServiceVfList();
@@ -93,24 +107,85 @@ public class ToscaParserImpl2 {
return vnfsMaps;
}
- private Map<String, VfModule> getVfModulesFromVF(ISdcCsarHelper csarHelper, String vfUuid) {
- Map<String,VfModule> vfModuleHashMap = new HashMap<String,VfModule>();
- for (Group group : csarHelper.getVfModulesByVf(vfUuid)) {
- vfModuleHashMap.put(group.getName(), populateVfModuleFromGroup(group));
+ private Map<String, PortMirroringConfig> extractPortMirroringConfigFromCsar(ISdcCsarHelper csarHelper) {
+ List<NodeTemplate> nodeTemplates = csarHelper.getServiceNodeTemplateBySdcType(SdcTypes.CONFIGURATION);
+ Map<String, PortMirroringConfig> configMaps = new HashMap<>();
+
+ for (NodeTemplate nodeTemplate : nodeTemplates) {
+ PortMirroringConfig pmConfig = new PortMirroringConfig();
+ populateNodeFromNodeTemplate(nodeTemplate, csarHelper, pmConfig);
+
+ pmConfig.setModelCustomizationName(nodeTemplate.getName());
+ pmConfig.setRequirementAssignments(nodeTemplate.getRequirements());
+ setSourceAndCollectorProxyNodes(csarHelper, pmConfig, nodeTemplate);
+
+ configMaps.put(nodeTemplate.getName(), pmConfig);
}
- return vfModuleHashMap;
+
+ return configMaps;
+ }
+
+ private Map<String, ServiceProxy> extractServiceProxyFromCsar(ISdcCsarHelper csarHelper) {
+ List<NodeTemplate> nodeTemplates = csarHelper.getServiceNodeTemplateBySdcType(SdcTypes.SERVICE_PROXY);
+ Map<String, ServiceProxy> serviceProxies = new HashMap<>();
+ for (NodeTemplate nodeTemplate: nodeTemplates) {
+ ServiceProxy serviceProxy = new ServiceProxy();
+ populateNodeFromNodeTemplate(nodeTemplate, csarHelper, serviceProxy);
+
+ Map<String, String> metadata = nodeTemplate.getMetaData().getAllProperties();
+ serviceProxy.setSourceModelUuid(metadata.get("sourceModelUuid"));
+ serviceProxy.setSourceModelInvariant(metadata.get("sourceModelInvariant"));
+ serviceProxy.setSourceModelName(metadata.get("sourceModelName"));
+
+ serviceProxies.put(nodeTemplate.getName(), serviceProxy);
+ }
+
+ return serviceProxies;
}
- private Map<String, VolumeGroup> getVolumeGroupsFromVF(ISdcCsarHelper csarHelper, String vfCustomizationUuid) {
- Map<String,VolumeGroup> volumeGroupMap = new HashMap<String,VolumeGroup>();
- List<Group> groups = csarHelper.getVfModulesByVf(vfCustomizationUuid);
- for (Group group : groups) {
- boolean isVolumeGroup = Boolean.valueOf(group.getPropertyValue(Constants.volume_group).toString());
- if (isVolumeGroup) {
- volumeGroupMap.put(group.getName(), populateVolumeGroupFromGroup(group));
+ private void setSourceAndCollectorProxyNodes(ISdcCsarHelper csarHelper, PortMirroringConfig portMirroringConfig, NodeTemplate nodeTemplate) {
+ RequirementAssignments requirementAssignments = nodeTemplate.getRequirements();
+
+ List<String> sourceNodes = getRequirementsNodesNames(requirementAssignments.getRequirementsByName("source").getAll());
+ portMirroringConfig.setSourceNodes(sourceNodes);
+
+ List<String> collectorNodes = getRequirementsNodesNames(requirementAssignments.getRequirementsByName("collector").getAll());
+ if (!collectorNodes.isEmpty()) { // vprobe
+ portMirroringConfig.setCollectorNodes(collectorNodes);
+ } else { // pprobe - configuration by policy
+ String collectorNodeName = csarHelper.getNodeTemplatePropertyLeafValue(nodeTemplate, "collector_node");
+ if (collectorNodeName != null) {
+ portMirroringConfig.setCollectorNodes(Arrays.asList(collectorNodeName));
+ portMirroringConfig.setConfigurationByPolicy(true);
}
}
- return volumeGroupMap;
+ }
+
+ private List<String> getRequirementsNodesNames(List<RequirementAssignment> requirements) {
+
+ List<String> requirementsNodes = new ArrayList<>();
+ if (requirements != null && requirements.size() > 0) {
+ requirementsNodes = requirements.stream().map(RequirementAssignment::getNodeTemplateName).collect(Collectors.toList());
+ }
+
+ return requirementsNodes;
+ }
+
+ Map<String, VfModule> getVfModulesFromVF(ISdcCsarHelper csarHelper, String vfUuid) {
+ List<Group> vfModulesByVf = csarHelper.getVfModulesByVf(vfUuid);
+ return vfModulesByVf.stream()
+ .collect(toMap(Group::getName, this::populateVfModuleFromGroup));
+ }
+
+ Map<String, VolumeGroup> getVolumeGroupsFromVF(ISdcCsarHelper csarHelper, String vfCustomizationUuid) {
+ List<Group> vfModulesByVf = csarHelper.getVfModulesByVf(vfCustomizationUuid);
+ return vfModulesByVf.stream()
+ .filter((group -> isVolumeGroup(group)))
+ .collect(toMap(Group::getName, this::populateVolumeGroupFromGroup));
+ }
+
+ private static Boolean isVolumeGroup(Group group) {
+ return Boolean.valueOf(group.getPropertyValue(Constants.volume_group).toString());
}
private Map<String, Network> extractNetworksFromCsar(ISdcCsarHelper csarHelper) {
@@ -124,6 +199,18 @@ public class ToscaParserImpl2 {
networksMap.put(nodeTemplate.getName(), newNetwork);
}
return networksMap;
+ }
+
+ private Map<String,Node> extractPnfsFromCsar(ISdcCsarHelper csarHelper) {
+ List<NodeTemplate> nodeTemplates = csarHelper.getServiceNodeTemplateBySdcType(SdcTypes.PNF);
+ HashMap<String, Node> pnfHashMap = new HashMap<>();
+
+ for (NodeTemplate nodeTemplate : nodeTemplates) {
+ Node pnf = new Node();
+ populateNodeFromNodeTemplate(nodeTemplate, csarHelper, pnf);
+ pnfHashMap.put(nodeTemplate.getName(), pnf);
+ }
+ return pnfHashMap;
}
private Map<String, VfModule> extractVfModuleFromCsar(ISdcCsarHelper csarHelper) {
@@ -148,10 +235,10 @@ public class ToscaParserImpl2 {
return volumeGroupHashMap;
}
- private Map<String, org.openecomp.vid.asdc.beans.tosca.Input> inputsListToInputsMap(List<org.openecomp.sdc.toscaparser.api.parameters.Input> inputList) {
- Map<String, org.openecomp.vid.asdc.beans.tosca.Input> inputs = new HashMap<>();
+ private Map<String, org.onap.vid.asdc.beans.tosca.Input> inputsListToInputsMap(List<org.openecomp.sdc.toscaparser.api.parameters.Input> inputList) {
+ Map<String, org.onap.vid.asdc.beans.tosca.Input> inputs = new HashMap<>();
for (org.openecomp.sdc.toscaparser.api.parameters.Input input : inputList) {
- inputs.put(input.getName(), convertInput(input, new org.openecomp.vid.asdc.beans.tosca.Input()));
+ inputs.put(input.getName(), convertInput(input, new org.onap.vid.asdc.beans.tosca.Input()));
}
return inputs;
}
@@ -164,6 +251,7 @@ public class ToscaParserImpl2 {
newNode.setName(nodeTemplate.getMetaData().getValue(Constants.name));
newNode.setVersion(nodeTemplate.getMetaData().getValue(Constants.version));
newNode.setInputs(extractInputsAndCommandsForNodeTemplate(nodeTemplate, csarHelper, newNode));
+ newNode.setType(nodeTemplate.getMetaData().getValue("type"));
Map<String, String> propertiesMap = setPropertiesOfVnf(nodeTemplate.getPropertiesObjects());
newNode.setProperties(propertiesMap);
return newNode;
@@ -176,7 +264,7 @@ public class ToscaParserImpl2 {
vfModule.setCustomizationUuid(group.getMetadata().getValue(Constants.vfModuleModelCustomizationUUID));
vfModule.setModelCustomizationName(group.getMetadata().getValue(Constants.vfModuleModelName));
vfModule.setName(group.getMetadata().getValue(Constants.vfModuleModelName));
- vfModule.setVolumeGroupAllowed(Boolean.valueOf((group.getPropertyValue(Constants.volume_group)).toString()));
+ vfModule.setVolumeGroupAllowed(isVolumeGroup(group));
vfModule.setDescription(group.getDescription());
vfModule.setInvariantUuid(group.getMetadata().getValue(Constants.vfModuleModelInvariantUUID));
vfModule.setUuid(group.getMetadata().getValue(Constants.vfModuleModelUUID));
@@ -197,8 +285,8 @@ public class ToscaParserImpl2 {
}
- private Map<String, org.openecomp.vid.asdc.beans.tosca.Input> extractInputsAndCommandsForNodeTemplate(NodeTemplate nodeTemplate, ISdcCsarHelper csarHelper, Node newNode){
- Map<String, org.openecomp.vid.asdc.beans.tosca.Input> inputMap = new HashMap<>();
+ private Map<String, org.onap.vid.asdc.beans.tosca.Input> extractInputsAndCommandsForNodeTemplate(NodeTemplate nodeTemplate, ISdcCsarHelper csarHelper, Node newNode){
+ Map<String, org.onap.vid.asdc.beans.tosca.Input> inputMap = new HashMap<>();
Map<String, CommandProperty> commandPropertyMap = new HashMap<>();
List<Input> inputs = csarHelper.getServiceInputs();
@@ -208,7 +296,7 @@ public class ToscaParserImpl2 {
String key = extractInputValue(inputKey);
for (Input input: inputs){
if(input.getName().equals(key)){
- org.openecomp.vid.asdc.beans.tosca.Input localInput = new org.openecomp.vid.asdc.beans.tosca.Input();
+ org.onap.vid.asdc.beans.tosca.Input localInput = new org.onap.vid.asdc.beans.tosca.Input();
localInput = convertInput(input, localInput);
String name = property.getKey();
commandPropertyMap.put(name, extractCommands(name, key));
@@ -224,7 +312,7 @@ public class ToscaParserImpl2 {
return inputKey.substring(inputKey.indexOf(":") + 1);
}
- private org.openecomp.vid.asdc.beans.tosca.Input convertInput(Input parserInput, org.openecomp.vid.asdc.beans.tosca.Input localInput){
+ private org.onap.vid.asdc.beans.tosca.Input convertInput(Input parserInput, org.onap.vid.asdc.beans.tosca.Input localInput){
localInput.setDefault(parserInput.getDefault());
localInput.setDescription(parserInput.getDescription());
localInput.setRequired(parserInput.isRequired());
@@ -250,5 +338,17 @@ public class ToscaParserImpl2 {
return propertiesMap;
}
+ private String validateInstantiationType(ISdcCsarHelper csarHelper){
+ String instantiationType = csarHelper.getServiceMetadata().getValue(Constants.instantiationType);
+ String validatedInstantiationType = Constants.clientConfig;
+ if(instantiationType != null && !instantiationType.isEmpty()){
+ if(instantiationType.equalsIgnoreCase(Constants.macro) || instantiationType.equalsIgnoreCase(Constants.both))
+ validatedInstantiationType = Constants.macro;
+ else if(instantiationType.equalsIgnoreCase(Constants.aLaCarte))
+ validatedInstantiationType = Constants.aLaCarte;
+ }
+ return validatedInstantiationType;
+ }
+
} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java b/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
index 67375aa6c..a8dc28716 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/asdc/rest/RestfulAsdcClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/asdc/rest/RestfulAsdcClient.java
@@ -1,467 +1,480 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.asdc.rest;
-
-import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Artifact;
-import org.openecomp.vid.asdc.beans.Resource;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl;
-import org.openecomp.vid.model.ModelConstants;
-import org.openecomp.vid.properties.VidProperties;
-
-import javax.ws.rs.NotFoundException;
-import javax.ws.rs.ProcessingException;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ResponseProcessingException;
-import javax.ws.rs.client.WebTarget;
-import javax.ws.rs.core.GenericType;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.nio.file.Files;
-import java.nio.file.Path;
-import java.nio.file.StandardCopyOption;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.UUID;
-
-/**
- * The Class RestfulAsdcClient.
- */
-@SuppressWarnings("Duplicates")
-public class RestfulAsdcClient implements AsdcClient {
-
- /**
- * The Class Builder.
- */
- public static class Builder {
-
- /**
- * The client.
- */
- private final Client client;
-
- /**
- * The uri.
- */
- private final URI uri;
-
- /**
- * The auth.
- */
- private String auth = null;
-
- /**
- * Instantiates a new builder.
- *
- * @param client the client
- * @param uri the uri
- */
- public Builder(Client client, URI uri) {
- this.client = client;
- this.client.register(JacksonJsonProvider.class);
- this.uri = uri;
- }
-
- /**
- * Auth.
- *
- * @param auth the auth
- * @return the builder
- */
- public Builder auth(String auth) {
- this.auth = auth;
- return this;
- }
-
- /**
- * Builds the.
- *
- * @return the restful asdc client
- */
- public RestfulAsdcClient build() {
- return new RestfulAsdcClient(this);
- }
- }
-
- /**
- * The Constant LOG.
- */
- static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RestfulAsdcClient.class);
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * The client.
- */
- private final Client client;
-
- /**
- * The uri.
- */
- private final URI uri;
-
- /**
- * The common headers.
- */
- private final MultivaluedHashMap<String, Object> commonHeaders;
-
- /**
- * The auth.
- */
- private final String auth;
-
- ToscaParserImpl p = new ToscaParserImpl();
-
- /**
- * Instantiates a new restful asdc client.
- *
- * @param builder the builder
- */
- private RestfulAsdcClient(Builder builder) {
- client = builder.client;
- uri = builder.uri;
- auth = builder.auth;
-
- commonHeaders = new MultivaluedHashMap<String, Object>();
- commonHeaders.put("X-ECOMP-InstanceID", Collections.singletonList((Object) "VID"));
- commonHeaders.put("Authorization", Collections.singletonList((Object) (auth)));
- }
-
- private Path createTmpFile(InputStream csarInputStream) throws AsdcCatalogException {
- final Path csarFile;
- try {
- csarFile = Files.createTempFile("csar", ".zip");
- Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
- } catch (IOException e) {
- throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
- }
- return csarFile;
- }
-
- /**
- * Gets the client.
- *
- * @return the client
- */
- private Client getClient() {
- return client;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResource(java.util.UUID)
- */
- public Resource getResource(UUID uuid) throws AsdcCatalogException {
-
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
- try {
- return getClient()
- .target(uri)
- .path(path + "/" + uuid.toString() + "/metadata")
- .request(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(Resource.class);
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
- */
- public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
- try {
- return getClient()
- .target(uri)
- .path(path + "/" + resourceUuid + "/artifacts/" + artifactUuid)
- .request(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(Artifact.class);
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResources()
- */
- public Collection<Resource> getResources() throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
- try {
- return getClient()
- .target(uri)
- .path(path)
- .request(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(new GenericType<Collection<Resource>>() {
- });
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResources(java.util.Map)
- */
- public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
- WebTarget target = getClient()
- .target(uri)
- .path(path);
-
- for (Entry<String, String[]> filterEntry : filter.entrySet()) {
- target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
- }
-
- try {
- return target.request()
- .accept(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(new GenericType<Collection<Resource>>() {
- });
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (NotFoundException e) {
- throw e;
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
- */
- public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
- try (final InputStream csarInputStream = (InputStream) getClient()
- .target(uri)
- .path(path + "/" + resourceUuid + "/toscaModel")
- .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
- .get(InputStream.class)) {
-
- return getToscaCsar(csarInputStream);
- } catch (IOException e) {
- throw new AsdcCatalogException("Failed to retrieve resource TOSCA model from ASDC", e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getService(java.util.UUID)
- */
- public Service getService(UUID uuid) throws AsdcCatalogException {
-
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
- try {
- return getClient()
- .target(uri)
- .path(path + "/" + uuid.toString() + "/metadata")
- .request(MediaType.APPLICATION_JSON)
- .headers(commonHeaders)
- .get(Service.class);
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
- */
- public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
-
- try {
- return getClient()
- .target(uri)
- .path(path + "/" + serviceUuid + "/artifacts/" + artifactUuid)
- .request(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(Artifact.class);
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServices()
- */
- public Collection<Service> getServices() throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
- try {
- return getClient()
- .target(uri)
- .path(path)
- .request()
- .accept(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(new GenericType<Collection<Service>>() {
- });
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServices(java.util.Map)
- */
- public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
-
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
- WebTarget target = getClient()
- .target(uri)
- .path(path);
-
-
- for (Entry<String, String[]> filterEntry : filter.entrySet()) {
- target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
- }
-
- try {
- return target.request()
- .accept(MediaType.APPLICATION_JSON_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_JSON)
- .get(new GenericType<Collection<Service>>() {
- });
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (NotFoundException e) {
- throw e;
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
- */
- public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
- String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
- try {
- final InputStream csarInputStream = (InputStream) getClient()
- .target(uri)
- .path(path + "/" + serviceUuid + "/toscaModel")
- .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
- .headers(commonHeaders)
- .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
- .get(InputStream.class);
-
-
- return getToscaCsar(csarInputStream);
- } catch (ResponseProcessingException e) {
- //Couldn't convert response to Java type
- throw new AsdcCatalogException("ASDC response could not be processed", e);
- } catch (ProcessingException e) {
- //IO problems during request
- throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
- } catch (WebApplicationException e) {
- //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
- throw new AsdcCatalogException(e);
- }
- }
-
-
- /**
- * Gets the tosca model.
- *
- * @param csarInputStream the csar input stream
- * @return the tosca model
- * @throws AsdcCatalogException the asdc catalog exception
- */
- private Path getToscaCsar(InputStream csarInputStream) throws AsdcCatalogException {
- return createTmpFile(csarInputStream);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.asdc.rest;
+
+import com.fasterxml.jackson.jaxrs.json.JacksonJsonProvider;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Artifact;
+import org.onap.vid.asdc.beans.Resource;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.parser.ToscaParserImpl;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.properties.VidProperties;
+
+import javax.ws.rs.NotFoundException;
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ResponseProcessingException;
+import javax.ws.rs.client.WebTarget;
+import javax.ws.rs.core.GenericType;
+import javax.ws.rs.core.MediaType;
+import javax.ws.rs.core.MultivaluedHashMap;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.StandardCopyOption;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.UUID;
+
+import static org.onap.vid.utils.Logging.getHttpServletRequest;
+import static org.onap.vid.utils.Logging.requestIdHeaderKey;
+/**
+ * The Class RestfulAsdcClient.
+ */
+@SuppressWarnings("Duplicates")
+public class RestfulAsdcClient implements AsdcClient {
+
+
+ /**
+ * The Class Builder.
+ */
+ public static class Builder {
+
+ /**
+ * The client.
+ */
+ private final Client client;
+
+ /**
+ * The uri.
+ */
+ private final URI uri;
+
+ /**
+ * The auth.
+ */
+ private String auth = null;
+
+ /**
+ * Instantiates a new builder.
+ *
+ * @param client the client
+ * @param uri the uri
+ */
+ public Builder(Client client, URI uri) {
+ this.client = client;
+ this.client.register(JacksonJsonProvider.class);
+ this.uri = uri;
+ }
+
+ /**
+ * Auth.
+ *
+ * @param auth the auth
+ * @return the builder
+ */
+ public Builder auth(String auth) {
+ this.auth = auth;
+ return this;
+ }
+
+ /**
+ * Builds the.
+ *
+ * @return the restful asdc client
+ */
+ public RestfulAsdcClient build() {
+ return new RestfulAsdcClient(this);
+ }
+ }
+
+ /**
+ * The Constant LOG.
+ */
+ static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RestfulAsdcClient.class);
+
+ /**
+ * The Constant dateFormat.
+ */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /**
+ * The client.
+ */
+ private final Client client;
+
+ /**
+ * The uri.
+ */
+ private final URI uri;
+
+ /**
+ * The common headers.
+ */
+ private final MultivaluedHashMap<String, Object> commonHeaders;
+
+ /**
+ * The auth.
+ */
+ private final String auth;
+
+ ToscaParserImpl p = new ToscaParserImpl();
+
+ /**
+ * Instantiates a new restful asdc client.
+ *
+ * @param builder the builder
+ */
+ private RestfulAsdcClient(Builder builder) {
+ client = builder.client;
+ uri = builder.uri;
+ auth = builder.auth;
+
+ commonHeaders = new MultivaluedHashMap<String, Object>();
+ commonHeaders.put("Authorization", Collections.singletonList((Object) (auth)));
+ }
+
+ private Path createTmpFile(InputStream csarInputStream) throws AsdcCatalogException {
+ final Path csarFile;
+ try {
+ csarFile = Files.createTempFile("csar", ".zip");
+ Files.copy(csarInputStream, csarFile, StandardCopyOption.REPLACE_EXISTING);
+ } catch (IOException e) {
+ throw new AsdcCatalogException("Caught IOException while creating CSAR", e);
+ }
+ return csarFile;
+ }
+
+ /**
+ * Gets the client.
+ *
+ * @return the client
+ */
+ private Client getClient() {
+ return client;
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getResource(java.util.UUID)
+ */
+ public Resource getResource(UUID uuid) throws AsdcCatalogException {
+
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+ try {
+ return getClient()
+ .target(uri)
+ .path(path + "/" + uuid.toString() + "/metadata")
+ .request(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(Resource.class);
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getResourceArtifact(java.util.UUID, java.util.UUID)
+ */
+ public Artifact getResourceArtifact(UUID resourceUuid, UUID artifactUuid) throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+ try {
+ return getClient()
+ .target(uri)
+ .path(path + "/" + resourceUuid + "/artifacts/" + artifactUuid)
+ .request(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(Artifact.class);
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getResources()
+ */
+ public Collection<Resource> getResources() throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+ try {
+ return getClient()
+ .target(uri)
+ .path(path)
+ .request(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(new GenericType<Collection<Resource>>() {
+ });
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getResources(java.util.Map)
+ */
+ public Collection<Resource> getResources(Map<String, String[]> filter) throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+ WebTarget target = getClient()
+ .target(uri)
+ .path(path);
+
+ for (Entry<String, String[]> filterEntry : filter.entrySet()) {
+ target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
+ }
+
+ try {
+ return target.request()
+ .accept(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(new GenericType<Collection<Resource>>() {
+ });
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (NotFoundException e) {
+ throw e;
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getResourceToscaModel(java.util.UUID)
+ */
+ public Path getResourceToscaModel(UUID resourceUuid) throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_RESOURCE_API_PATH, ModelConstants.DEFAULT_ASDC_RESOURCE_API_PATH);
+ try (final InputStream csarInputStream = (InputStream) getClient()
+ .target(uri)
+ .path(path + "/" + resourceUuid + "/toscaModel")
+ .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(InputStream.class)) {
+
+ return getToscaCsar(csarInputStream);
+ } catch (IOException e) {
+ throw new AsdcCatalogException("Failed to retrieve resource TOSCA model from ASDC", e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getService(java.util.UUID)
+ */
+ public Service getService(UUID uuid) throws AsdcCatalogException {
+
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+ try {
+ return getClient()
+ .target(uri)
+ .path(path + "/" + uuid.toString() + "/metadata")
+ .request(MediaType.APPLICATION_JSON)
+ .headers(commonHeaders)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(Service.class);
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getServiceArtifact(java.util.UUID, java.util.UUID)
+ */
+ public Artifact getServiceArtifact(UUID serviceUuid, UUID artifactUuid) throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+
+ try {
+ return getClient()
+ .target(uri)
+ .path(path + "/" + serviceUuid + "/artifacts/" + artifactUuid)
+ .request(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(Artifact.class);
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getServices()
+ */
+ public Collection<Service> getServices() throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+ try {
+ return getClient()
+ .target(uri)
+ .path(path)
+ .request()
+ .accept(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(new GenericType<Collection<Service>>() {
+ });
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getServices(java.util.Map)
+ */
+ public Collection<Service> getServices(Map<String, String[]> filter) throws AsdcCatalogException {
+
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+ WebTarget target = getClient()
+ .target(uri)
+ .path(path);
+
+
+ for (Entry<String, String[]> filterEntry : filter.entrySet()) {
+ target = target.queryParam(filterEntry.getKey(), (Object[]) filterEntry.getValue());
+ }
+
+ try {
+ return target.request()
+ .accept(MediaType.APPLICATION_JSON_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_JSON)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(new GenericType<Collection<Service>>() {
+ });
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (NotFoundException e) {
+ throw e;
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.onap.vid.asdc.AsdcClient#getServiceToscaModel(java.util.UUID)
+ */
+ public Path getServiceToscaModel(UUID serviceUuid) throws AsdcCatalogException {
+ String path = VidProperties.getPropertyWithDefault(ModelConstants.ASDC_SVC_API_PATH, ModelConstants.DEFAULT_ASDC_SVC_API_PATH);
+ try {
+ final InputStream csarInputStream = (InputStream) getClient()
+ .target(uri)
+ .path(path + "/" + serviceUuid + "/toscaModel")
+ .request(MediaType.APPLICATION_OCTET_STREAM_TYPE)
+ .headers(commonHeaders)
+ .header("Content-Type", MediaType.APPLICATION_OCTET_STREAM)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get(InputStream.class);
+
+
+ return getToscaCsar(csarInputStream);
+ } catch (ResponseProcessingException e) {
+ //Couldn't convert response to Java type
+ throw new AsdcCatalogException("ASDC response could not be processed", e);
+ } catch (ProcessingException e) {
+ //IO problems during request
+ throw new AsdcCatalogException("Failed to get a response from ASDC service", e);
+ } catch (WebApplicationException e) {
+ //Web service returned data, but the response status wasn't a good one (i.e. non 2xx)
+ throw new AsdcCatalogException(e);
+ }
+ }
+
+
+ /**
+ * Gets the tosca model.
+ *
+ * @param csarInputStream the csar input stream
+ * @return the tosca model
+ * @throws AsdcCatalogException the asdc catalog exception
+ */
+ private Path getToscaCsar(InputStream csarInputStream) throws AsdcCatalogException {
+ return createTmpFile(csarInputStream);
+ }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java
new file mode 100644
index 000000000..89d3963ac
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionResponse.java
@@ -0,0 +1,15 @@
+package org.onap.vid.category;
+
+import org.onap.vid.model.ListOfErrorsResponse;
+
+import java.util.List;
+
+public class AddCategoryOptionResponse extends ListOfErrorsResponse {
+
+ public AddCategoryOptionResponse() {
+ }
+
+ public AddCategoryOptionResponse(List<String> errors) {
+ super(errors);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java
new file mode 100644
index 000000000..5db474627
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/AddCategoryOptionsRequest.java
@@ -0,0 +1,13 @@
+package org.onap.vid.category;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class AddCategoryOptionsRequest {
+
+ public List<String> options;
+
+ public AddCategoryOptionsRequest() {
+ options = new ArrayList<>();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java
new file mode 100644
index 000000000..355e54838
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParameterOptionRep.java
@@ -0,0 +1,31 @@
+package org.onap.vid.category;
+
+public class CategoryParameterOptionRep {
+
+ private String id;
+ private String name;
+
+ public CategoryParameterOptionRep() {
+ }
+
+ public CategoryParameterOptionRep(String id, String name) {
+ this.id = id;
+ this.name = name;
+ }
+
+ public String getId() {
+ return id;
+ }
+
+ public void setId(String id) {
+ this.id = id;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java
new file mode 100644
index 000000000..be7886698
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/category/CategoryParametersResponse.java
@@ -0,0 +1,27 @@
+package org.onap.vid.category;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+import java.util.List;
+import java.util.Map;
+
+public class CategoryParametersResponse {
+
+ private Map<String, List<CategoryParameterOptionRep>> categoryParameters;
+
+ public CategoryParametersResponse() {
+ }
+
+ public CategoryParametersResponse(Map<String, List<CategoryParameterOptionRep>> categoryParameters) {
+ this.categoryParameters = categoryParameters;
+ }
+
+ @JsonProperty("categoryParameters")
+ public Map<String, List<CategoryParameterOptionRep>> getCategoryParameters() {
+ return categoryParameters;
+ }
+
+ public void setCategoryParameters(Map<String, List<CategoryParameterOptionRep>> categoryParameters) {
+ this.categoryParameters = categoryParameters;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
index adcb54683..ec375b621 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementRequest.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementRequest.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.List;
import java.util.HashMap;
@@ -15,8 +15,18 @@ import com.fasterxml.jackson.annotation.JsonPropertyOrder;
})
public class ChangeManagementRequest {
-
- public ChangeManagementRequest() {}
+
+ public static class MsoChangeManagementRequest {
+ public final static String SOFTWARE_UPDATE = "inPlaceSoftwareUpdate";
+ public static final String REPLACE = "replace";
+ public final static String CONFIG_UPDATE = "applyUpdatedConfig";
+
+ }
+
+ public final static String VNF_IN_PLACE_SOFTWARE_UPDATE = "vnf in place software update";
+ public static final String UPDATE = "update";
+ public static final String REPLACE = "replace";
+ public final static String CONFIG_UPDATE = "vnf config update";
@JsonProperty("requestDetails")
private List<RequestDetails> requestDetails;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
index 10ba035d6..05d6e0496 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ChangeManagementResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ChangeManagementResponse.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.ArrayList;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
index a5debc6db..43d6a6a0a 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CloudConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CloudConfiguration.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.HashMap;
import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
index 70e09d83c..8aba0124a 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/CmResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/CmResponse.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
public class CmResponse {
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java
new file mode 100644
index 000000000..0412204f9
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetVnfWorkflowRelationRequest.java
@@ -0,0 +1,28 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class GetVnfWorkflowRelationRequest {
+
+ public GetVnfWorkflowRelationRequest() {
+ }
+
+ public GetVnfWorkflowRelationRequest(List<VnfDetails> vnfsDetails) {
+ this.vnfsDetails = vnfsDetails;
+ }
+
+ @JsonProperty("vnfsDetails")
+ private List<VnfDetails> vnfsDetails;
+
+ @JsonProperty("vnfsDetails")
+ public List<VnfDetails> getVnfDetails() {
+ return vnfsDetails;
+ }
+
+ @JsonProperty("vnfsDetails")
+ public void setVnfDetails(List<VnfDetails> vnfDetails) {
+ this.vnfsDetails = vnfDetails;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java
new file mode 100644
index 000000000..05295fbc6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/GetWorkflowsResponse.java
@@ -0,0 +1,24 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+public class GetWorkflowsResponse {
+ private List<String> workflows;
+
+ public GetWorkflowsResponse() {
+ }
+
+ public GetWorkflowsResponse(List<String> workflows) {
+ this.workflows = workflows;
+ }
+
+ public List<String> getWorkflows() {
+ return workflows;
+ }
+
+ public void setWorkflows(List<String> workflows) {
+ this.workflows = workflows;
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
index 663ff8c49..6011c7ebb 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/LeanCloudConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/LeanCloudConfiguration.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
/**
* Created by Oren on 9/5/17.
@@ -8,7 +8,7 @@ public class LeanCloudConfiguration {
public LeanCloudConfiguration() {
}
- public LeanCloudConfiguration(org.openecomp.vid.domain.mso.CloudConfiguration cloudConfiguration) {
+ public LeanCloudConfiguration(org.onap.vid.domain.mso.CloudConfiguration cloudConfiguration) {
this.tenantId = cloudConfiguration.getTenantId();
this.lcpCloudRegionId = cloudConfiguration.getLcpCloudRegionId();
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
index 517628ca0..8f44a4bf6 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfo.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.HashMap;
import java.util.Map;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
@@ -24,7 +24,7 @@ public class ModelInfo {
}
- public ModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo){
+ public ModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo){
this.setModelType(modelInfo.getModelType().toString());
this.setModelInvariantId(modelInfo.getModelInvariantId());
this.setModelVersionId(modelInfo.getModelNameVersionId());
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
index c60ed2f77..7e8760987 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/ModelInfoOfRelatedInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/ModelInfoOfRelatedInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.HashMap;
import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
index 9e442f28b..913fa0787 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/MsoRequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/MsoRequestDetails.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.ArrayList;
@@ -17,13 +17,14 @@ public class MsoRequestDetails {
public List<RelatedInstanceList> relatedInstanceList;
- public RequestParameters requestParameters;
+ public Object requestParameters;
public MsoRequestDetails(RequestDetails r) {
this.modelInfo = new ModelInfo(r.getModelInfo());
this.cloudConfiguration = new LeanCloudConfiguration(r.getCloudConfiguration());
this.requestInfo = new UpdateRequestInfo(r.getRequestInfo());
this.relatedInstanceList = new ArrayList<>();
+ this.requestParameters = r.getRequestParameters();
relatedInstanceList = r.getRelatedInstList();
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
index 49368c20e..c29aee454 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstance.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import com.fasterxml.jackson.annotation.*;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
index 21a41c3f7..b3e67a020 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RelatedInstanceList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RelatedInstanceList.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import com.fasterxml.jackson.annotation.*;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
index 94e4c4468..36452f67f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetails.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import com.fasterxml.jackson.annotation.*;
@@ -13,7 +13,7 @@ import java.util.List;
"vnfName",
"vnfInstanceId"
})
-public class RequestDetails extends org.openecomp.vid.mso.rest.RequestDetails{
+public class RequestDetails extends org.onap.vid.mso.rest.RequestDetails{
@JsonProperty("vnfName")
private String vnfName;
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java
new file mode 100644
index 000000000..92fb57c2d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestDetailsWrapper.java
@@ -0,0 +1,16 @@
+package org.onap.vid.changeManagement;
+
+/**
+ * Created by Oren on 9/5/17.
+ */
+public class RequestDetailsWrapper<T> {
+
+ public RequestDetailsWrapper(T requestDetails) {
+ this.requestDetails = requestDetails;
+ }
+
+ public RequestDetailsWrapper() {
+ }
+
+ public T requestDetails;
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
index a7236c4b1..4aa3724af 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestInfo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/RequestInfo.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
import java.util.HashMap;
import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
index ab8189484..024e9c3c1 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/UpdateRequestInfo.java
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/UpdateRequestInfo.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.changeManagement;
+package org.onap.vid.changeManagement;
-import org.openecomp.vid.domain.mso.*;
+import org.onap.vid.domain.mso.*;
/**
* Created by Oren on 9/5/17.
@@ -11,7 +11,7 @@ public class UpdateRequestInfo {
}
- public UpdateRequestInfo(org.openecomp.vid.domain.mso.RequestInfo requestInfo) {
+ public UpdateRequestInfo(org.onap.vid.domain.mso.RequestInfo requestInfo) {
this.requestorId = requestInfo.getRequestorId();
this.suppressRollback = requestInfo.getSuppressRollback();
this.source = requestInfo.getSource();
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java
new file mode 100644
index 000000000..5cc2f4d32
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetails.java
@@ -0,0 +1,67 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.MoreObjects;
+
+public class VnfDetails {
+
+ public VnfDetails() {
+ }
+
+ public VnfDetails(String UUID, String invariantUUID) {
+ this.UUID = UUID;
+ this.invariantUUID = invariantUUID;
+ }
+
+ @JsonProperty("UUID")
+ private String UUID;
+
+ @JsonProperty("invariantUUID")
+ private String invariantUUID;
+
+ @JsonProperty("UUID")
+ public String getUUID() {
+ return UUID;
+ }
+
+ @JsonProperty("UUID")
+ public void setUUID(String uUID) {
+ UUID = uUID;
+ }
+
+ @JsonProperty("invariantUUID")
+ public String getInvariantUUID() {
+ return invariantUUID;
+ }
+
+ @JsonProperty("invariantUUID")
+ public void setInvariantUUID(String invariantUUID) {
+ this.invariantUUID = invariantUUID;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ VnfDetails that = (VnfDetails) o;
+
+ if (getUUID() != null ? !getUUID().equals(that.getUUID()) : that.getUUID() != null) return false;
+ return getInvariantUUID() != null ? getInvariantUUID().equals(that.getInvariantUUID()) : that.getInvariantUUID() == null;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = getUUID() != null ? getUUID().hashCode() : 0;
+ result = 31 * result + (getInvariantUUID() != null ? getInvariantUUID().hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "VnfDetails{" +
+ "UUID='" + UUID + '\'' +
+ ", invariantUUID='" + invariantUUID + '\'' +
+ '}';
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java
new file mode 100644
index 000000000..db162999f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfDetailsWithWorkflows.java
@@ -0,0 +1,36 @@
+package org.onap.vid.changeManagement;
+
+import org.onap.vid.model.VNFDao;
+import org.onap.vid.model.VidWorkflow;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class VnfDetailsWithWorkflows extends VnfDetails {
+
+ private List<String> workflows;
+
+ public VnfDetailsWithWorkflows() {
+ }
+
+
+ @SuppressWarnings("WeakerAccess")
+ public VnfDetailsWithWorkflows(String UUID, String invariantUUID, List<String> workflows) {
+ super(UUID, invariantUUID);
+ this.workflows = workflows;
+ }
+
+ public VnfDetailsWithWorkflows(VNFDao vnfDao) {
+ this(vnfDao.getVnfUUID(),
+ vnfDao.getVnfInvariantUUID(),
+ vnfDao.getWorkflows().stream().map(VidWorkflow::getWokflowName).collect(Collectors.toList()));
+ }
+
+ public List<String> getWorkflows() {
+ return workflows;
+ }
+
+ public void setWorkflows(List<String> workflows) {
+ this.workflows = workflows;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java
new file mode 100644
index 000000000..5c9af661e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationAllResponse.java
@@ -0,0 +1,23 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+public class VnfWorkflowRelationAllResponse {
+
+ private List<VnfDetailsWithWorkflows> vnfs;
+
+ public VnfWorkflowRelationAllResponse() {
+ }
+
+ public VnfWorkflowRelationAllResponse(List<VnfDetailsWithWorkflows> vnfs) {
+ this.vnfs = vnfs;
+ }
+
+ public List<VnfDetailsWithWorkflows> getVnfs() {
+ return vnfs;
+ }
+
+ public void setVnfs(List<VnfDetailsWithWorkflows> vnfs) {
+ this.vnfs = vnfs;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java
new file mode 100644
index 000000000..cc9abae27
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationRequest.java
@@ -0,0 +1,31 @@
+package org.onap.vid.changeManagement;
+
+import java.util.List;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public class VnfWorkflowRelationRequest {
+
+ public VnfWorkflowRelationRequest() {
+ }
+
+ public VnfWorkflowRelationRequest(List<WorkflowsDetail> workflowsDetails) {
+ this.workflowsDetails = workflowsDetails;
+ }
+
+ @JsonProperty("workflowsDetails")
+ private List<WorkflowsDetail> workflowsDetails;
+
+ @JsonProperty("workflowsDetails")
+ public List<WorkflowsDetail> getWorkflowsDetails() {
+ return workflowsDetails;
+ }
+
+ @JsonProperty("workflowsDetails")
+ public void setWorkflowsDetails(List<WorkflowsDetail> workflowsDetails) {
+ this.workflowsDetails = workflowsDetails;
+ }
+
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java
new file mode 100644
index 000000000..98ebc89ea
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/VnfWorkflowRelationResponse.java
@@ -0,0 +1,15 @@
+package org.onap.vid.changeManagement;
+
+import org.onap.vid.model.ListOfErrorsResponse;
+
+import java.util.List;
+
+public class VnfWorkflowRelationResponse extends ListOfErrorsResponse {
+
+ public VnfWorkflowRelationResponse() {
+ }
+
+ public VnfWorkflowRelationResponse(List<String> errors) {
+ super(errors);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java b/vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java
new file mode 100644
index 000000000..e833ecb28
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/changeManagement/WorkflowsDetail.java
@@ -0,0 +1,44 @@
+package org.onap.vid.changeManagement;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.MoreObjects;
+
+public class WorkflowsDetail {
+
+ public WorkflowsDetail() {
+ }
+
+ public WorkflowsDetail(VnfDetails vnfDetails, String workflowName) {
+ this.vnfDetails = vnfDetails;
+ this.workflowName = workflowName;
+ }
+
+ @JsonProperty("vnfDetails")
+ private VnfDetails vnfDetails;
+
+ @JsonProperty("workflowName")
+ private String workflowName;
+
+ @JsonProperty("vnfDetails")
+ public VnfDetails getVnfDetails() {
+ return vnfDetails;
+ }
+ @JsonProperty("vnfDetails")
+ public void setVnfDetails(VnfDetails vnfDetails) {
+ this.vnfDetails = vnfDetails;
+ }
+ @JsonProperty("workflowName")
+ public String getWorkflowName() {
+ return workflowName;
+ }
+ @JsonProperty("workflowName")
+ public void setWorkflowName(String workflowName) {
+ this.workflowName = workflowName;
+ }
+
+ @Override
+ public String toString() {
+ return vnfDetails +
+ ", workflowName='" + workflowName;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java b/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
index 226e6c4d2..69ce11f4b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/FakeHttpSession.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/FakeHttpSession.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.client;
+package org.onap.vid.client;
import org.apache.commons.io.IOUtils;
import org.json.JSONArray;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java b/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
index ef2ade914..d0a34ce38 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpBasicClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/HttpBasicClient.java
@@ -1,67 +1,67 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.client;
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.servlet.ServletContext;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- * General HTTP client.
- */
-
-public class HttpBasicClient{
-
- /** The servlet context. */
- @Autowired
- private ServletContext servletContext;
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * Obtain a basic HTTP client .
- *
- * @return Client client object
- * @throws Exception the exception
- */
- public static Client getClient() throws Exception {
-
- ClientConfig config = new ClientConfig();
- config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-
- return ClientBuilder.newClient(config)
- .register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.client;
+
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import javax.servlet.ServletContext;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+/**
+ * General HTTP client.
+ */
+
+public class HttpBasicClient{
+
+ /** The servlet context. */
+ @Autowired
+ private ServletContext servletContext;
+
+ /** The logger. */
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpBasicClient.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /**
+ * Obtain a basic HTTP client .
+ *
+ * @return Client client object
+ * @throws Exception the exception
+ */
+ public static Client getClient() throws Exception {
+
+ ClientConfig config = new ClientConfig();
+ config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+
+ return ClientBuilder.newClient(config)
+ .register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java b/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
index 676a7e798..28a4d0f9f 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/client/HttpsBasicClient.java
+++ b/vid-app-common/src/main/java/org/onap/vid/client/HttpsBasicClient.java
@@ -1,143 +1,143 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.client;
-
-import java.io.File;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.HttpsURLConnection;
-import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSession;
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.ClientBuilder;
-
-import org.eclipse.jetty.util.security.Password;
-import org.glassfish.jersey.client.ClientConfig;
-import org.glassfish.jersey.client.ClientProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.properties.VidProperties;
-
- /**
- * General SSL client using the VID tomcat keystore. It doesn't use client certificates.
- */
-
-public class HttpsBasicClient{
-
- /** The logger. */
- static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsBasicClient.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * Retrieve an SSL client.
- *
- * @return Client The SSL client
- * @throws Exception the exception
- */
- public static Client getClient() throws Exception {
- String methodName = "getClient";
- ClientConfig config = new ClientConfig();
- //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
- //config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-
- SSLContext ctx = null;
-
- try {
-
- config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
-
- String truststore_path = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_FILENAME);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " truststore_path=" + truststore_path);
- String truststore_password = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_PASSWD_X);
-
-
- String decrypted_truststore_password = Password.deobfuscate(truststore_password);
- //logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
-
- File tr = new File (truststore_path);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute truststore path=" + tr.getAbsolutePath());
-
- //String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
- //String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
- //String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
-
- System.setProperty("javax.net.ssl.trustStore", truststore_path);
- System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
- HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
- public boolean verify(String string,SSLSession ssls) {
- return true;
- }
- });
-
- //May need to make the algorithm a parameter. MSO requires TLSv1.1 or TLSv1.2
- ctx = SSLContext.getInstance("TLSv1.2");
-
- /*
- KeyManagerFactory kmf = null;
- try {
- kmf = KeyManagerFactory.getInstance("SunX509");
- FileInputStream fin = new FileInputStream(keystore_path);
- KeyStore ks = KeyStore.getInstance("PKCS12");
- char[] pwd = decrypted_keystore_password.toCharArray();
- ks.load(fin, pwd);
- kmf.init(ks, pwd);
- } catch (Exception e) {
- System.out.println("Error setting up kmf: exiting");
- e.printStackTrace();
- System.exit(1);
- }
-
- ctx.init(kmf.getKeyManagers(), null, null);
- */
- ctx.init(null, null, null);
- //config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
- // new HTTPSProperties( , ctx));
-
- return ClientBuilder.newBuilder()
- .sslContext(ctx)
- .hostnameVerifier(new HostnameVerifier() {
- @Override
- public boolean verify( String s, SSLSession sslSession ) {
- return true;
- }
- }).withConfig(config)
- .build()
- .register(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
-
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
- //System.out.println("Error setting up config: exiting");
- e.printStackTrace();
- return null;
- }
-
- //Client client = ClientBuilder.newClient(config);
- // uncomment this line to get more logging for the request/response
- // client.addFilter(new LoggingFilter(System.out));
-
- //return client;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.client;
+
+import java.io.File;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import javax.net.ssl.HostnameVerifier;
+import javax.net.ssl.HttpsURLConnection;
+import javax.net.ssl.SSLContext;
+import javax.net.ssl.SSLSession;
+import javax.ws.rs.client.Client;
+import javax.ws.rs.client.ClientBuilder;
+
+import org.eclipse.jetty.util.security.Password;
+import org.glassfish.jersey.client.ClientConfig;
+import org.glassfish.jersey.client.ClientProperties;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.properties.VidProperties;
+
+ /**
+ * General SSL client using the VID tomcat keystore. It doesn't use client certificates.
+ */
+
+public class HttpsBasicClient{
+
+ /** The logger. */
+ static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HttpsBasicClient.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /**
+ * Retrieve an SSL client.
+ *
+ * @return Client The SSL client
+ * @throws Exception the exception
+ */
+ public static Client getClient() throws Exception {
+ String methodName = "getClient";
+ ClientConfig config = new ClientConfig();
+ //config.getFeatures().put(JSONConfiguration.FEATURE_POJO_MAPPING, Boolean.TRUE);
+ //config.getClasses().add(org.openecomp.aai.util.CustomJacksonJaxBJsonProvider.class);
+
+ SSLContext ctx = null;
+
+ try {
+
+ config.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true);
+
+ String truststore_path = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_FILENAME);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " truststore_path=" + truststore_path);
+ String truststore_password = SystemProperties.getProperty(VidProperties.VID_TRUSTSTORE_PASSWD_X);
+
+
+ String decrypted_truststore_password = Password.deobfuscate(truststore_password);
+ //logger.debug(dateFormat.format(new Date()) + " " + methodName + " decrypted_truststore_password=" + decrypted_truststore_password);
+
+ File tr = new File (truststore_path);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " " + methodName + " absolute truststore path=" + tr.getAbsolutePath());
+
+ //String keystore_path = certFilePath + AAIProperties.FILESEPARTOR + SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_FILENAME);
+ //String keystore_password = SystemProperties.getProperty(AAIProperties.AAI_KEYSTORE_PASSWD_X);
+ //String decrypted_keystore_password = EncryptedPropValue.decryptTriple(keystore_password);
+
+ System.setProperty("javax.net.ssl.trustStore", truststore_path);
+ System.setProperty("javax.net.ssl.trustStorePassword", decrypted_truststore_password);
+ HttpsURLConnection.setDefaultHostnameVerifier( new HostnameVerifier(){
+ public boolean verify(String string,SSLSession ssls) {
+ return true;
+ }
+ });
+
+ //May need to make the algorithm a parameter. MSO requires TLSv1.1 or TLSv1.2
+ ctx = SSLContext.getInstance("TLSv1.2");
+
+ /*
+ KeyManagerFactory kmf = null;
+ try {
+ kmf = KeyManagerFactory.getInstance("SunX509");
+ FileInputStream fin = new FileInputStream(keystore_path);
+ KeyStore ks = KeyStore.getInstance("PKCS12");
+ char[] pwd = decrypted_keystore_password.toCharArray();
+ ks.load(fin, pwd);
+ kmf.init(ks, pwd);
+ } catch (Exception e) {
+ System.out.println("Error setting up kmf: exiting");
+ e.printStackTrace();
+ System.exit(1);
+ }
+
+ ctx.init(kmf.getKeyManagers(), null, null);
+ */
+ ctx.init(null, null, null);
+ //config.getProperties().put(HTTPSProperties.PROPERTY_HTTPS_PROPERTIES,
+ // new HTTPSProperties( , ctx));
+
+ return ClientBuilder.newBuilder()
+ .sslContext(ctx)
+ .hostnameVerifier(new HostnameVerifier() {
+ @Override
+ public boolean verify( String s, SSLSession sslSession ) {
+ return true;
+ }
+ }).withConfig(config)
+ .build()
+ .register(org.onap.vid.aai.util.CustomJacksonJaxBJsonProvider.class);
+
+ } catch (Exception e) {
+ logger.debug(EELFLoggerDelegate.debugLogger, "Error setting up config: exiting");
+ //System.out.println("Error setting up config: exiting");
+ e.printStackTrace();
+ return null;
+ }
+
+ //Client client = ClientBuilder.newClient(config);
+ // uncomment this line to get more logging for the request/response
+ // client.addFilter(new LoggingFilter(System.out));
+
+ //return client;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
index a8bdf39bb..1719ff6d4 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/AaiController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/AaiController.java
@@ -1,952 +1,750 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import org.codehaus.jackson.JsonGenerationException;
-import org.codehaus.jackson.map.JsonMappingException;
-import org.codehaus.jackson.map.ObjectMapper;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.openecomp.aai.util.AAIRestInterface;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.domain.User;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.aai.AaiResponse;
-import org.openecomp.vid.aai.SubscriberData;
-import org.openecomp.vid.aai.SubscriberFilteredResults;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.VersionByInvariantIdsRequest;
-import org.openecomp.vid.roles.Role;
-import org.openecomp.vid.roles.RoleProvider;
-import org.openecomp.vid.roles.RoleValidator;
-import org.openecomp.vid.services.AaiService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.MediaType;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.*;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-import javax.ws.rs.BadRequestException;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.QueryParam;
-import javax.ws.rs.WebApplicationException;
-import javax.ws.rs.core.Response;
-import java.io.File;
-import java.io.IOException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
-
-/**
- * Controller to handle a&ai requests.
- */
-
-@RestController
-public class AaiController extends RestrictedBaseController {
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
- /**
- * The from app id.
- */
- protected String fromAppId = "VidAaiController";
- /**
- * The view name.
- */
- String viewName;
- /**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiController.class);
- /**
- * The model.
- */
- private Map<String, Object> model = new HashMap<String, Object>();
- /**
- * The servlet context.
- */
- @Autowired
- private ServletContext servletContext;
- /**
- * aai service
- */
- @Autowired
- private AaiService aaiService;
- public AaiController() {
-
- }
-
- public AaiController(ServletContext servletContext) {
- this.servletContext = servletContext;
-
- }
-
- /**
- * Return tenant details.
- *
- * @param jsonObject the json object
- * @return String The parsing results
- */
- public static String parseCustomerObjectForTenants(JSONObject jsonObject) {
-
- JSONArray tenantArray = new JSONArray();
- boolean bconvert = false;
-
- try {
-
- JSONObject serviceSubsObj = (JSONObject) jsonObject.get("service-subscriptions");
-
- if (serviceSubsObj != null) {
- JSONArray srvcSubArray = (JSONArray) serviceSubsObj.get("service-subscription");
-
- if (srvcSubArray != null) {
- Iterator i = srvcSubArray.iterator();
-
- while (i.hasNext()) {
-
- JSONObject innerObj = (JSONObject) i.next();
-
- if (innerObj == null)
- continue;
-
- JSONObject relationShipListsObj = (JSONObject) innerObj.get("relationship-list");
- if (relationShipListsObj != null) {
- JSONArray rShipArray = (JSONArray) relationShipListsObj.get("relationship");
- if (rShipArray != null) {
- Iterator i1 = rShipArray.iterator();
-
- while (i1.hasNext()) {
-
- JSONObject inner1Obj = (JSONObject) i1.next();
-
- if (inner1Obj == null)
- continue;
-
- String relatedTo = checkForNull((String) inner1Obj.get("related-to"));
- if (relatedTo.equalsIgnoreCase("tenant")) {
- JSONObject tenantNewObj = new JSONObject();
-
- String relatedLink = checkForNull((String) inner1Obj.get("related-link"));
- tenantNewObj.put("link", relatedLink);
-
- JSONArray rDataArray = (JSONArray) inner1Obj.get("relationship-data");
- if (rDataArray != null) {
- Iterator i2 = rDataArray.iterator();
-
- while (i2.hasNext()) {
- JSONObject inner2Obj = (JSONObject) i2.next();
-
- if (inner2Obj == null)
- continue;
-
- String rShipKey = checkForNull((String) inner2Obj.get("relationship-key"));
- String rShipVal = checkForNull((String) inner2Obj.get("relationship-value"));
- if (rShipKey.equalsIgnoreCase("cloud-region.cloud-owner")) {
- tenantNewObj.put("cloudOwner", rShipVal);
- } else if (rShipKey.equalsIgnoreCase("cloud-region.cloud-region-id")) {
- tenantNewObj.put("cloudRegionID", rShipVal);
- }
-
- if (rShipKey.equalsIgnoreCase("tenant.tenant-id")) {
- tenantNewObj.put("tenantID", rShipVal);
- }
- }
- }
-
- JSONArray relatedTPropArray = (JSONArray) inner1Obj.get("related-to-property");
- if (relatedTPropArray != null) {
- Iterator i3 = relatedTPropArray.iterator();
-
- while (i3.hasNext()) {
- JSONObject inner3Obj = (JSONObject) i3.next();
-
- if (inner3Obj == null)
- continue;
-
- String propKey = checkForNull((String) inner3Obj.get("property-key"));
- String propVal = checkForNull((String) inner3Obj.get("property-value"));
- if (propKey.equalsIgnoreCase("tenant.tenant-name")) {
- tenantNewObj.put("tenantName", propVal);
- }
- }
- }
- bconvert = true;
- tenantArray.add(tenantNewObj);
- }
- }
- }
- }
- }
- }
- }
- } catch (NullPointerException ex) {
-
-
- }
-
- if (bconvert)
- return tenantArray.toJSONString();
- else
- return "";
-
- }
-
-
- /**
- * Retrieve the service subscription from the jsonObject.
- *
- * @param jsonObject the json object
- * @return String
- */
- public static String parseServiceSubscriptionObjectForTenants(JSONObject jsonObject) {
-
- JSONArray tenantArray = new JSONArray();
- boolean bconvert = false;
-
- try {
- JSONObject relationShipListsObj = (JSONObject) jsonObject.get("relationship-list");
- if (relationShipListsObj != null) {
- JSONArray rShipArray = (JSONArray) relationShipListsObj.get("relationship");
- if (rShipArray != null) {
- Iterator i1 = rShipArray.iterator();
-
- while (i1.hasNext()) {
-
- JSONObject inner1Obj = (JSONObject) i1.next();
-
- if (inner1Obj == null)
- continue;
-
- String relatedTo = checkForNull((String) inner1Obj.get("related-to"));
- if (relatedTo.equalsIgnoreCase("tenant")) {
- JSONObject tenantNewObj = new JSONObject();
-
- String relatedLink = checkForNull((String) inner1Obj.get("related-link"));
- tenantNewObj.put("link", relatedLink);
-
- JSONArray rDataArray = (JSONArray) inner1Obj.get("relationship-data");
- if (rDataArray != null) {
- Iterator i2 = rDataArray.iterator();
-
- while (i2.hasNext()) {
- JSONObject inner2Obj = (JSONObject) i2.next();
-
- if (inner2Obj == null)
- continue;
-
- String rShipKey = checkForNull((String) inner2Obj.get("relationship-key"));
- String rShipVal = checkForNull((String) inner2Obj.get("relationship-value"));
- if (rShipKey.equalsIgnoreCase("cloud-region.cloud-owner")) {
- tenantNewObj.put("cloudOwner", rShipVal);
- } else if (rShipKey.equalsIgnoreCase("cloud-region.cloud-region-id")) {
- tenantNewObj.put("cloudRegionID", rShipVal);
- }
-
- if (rShipKey.equalsIgnoreCase("tenant.tenant-id")) {
- tenantNewObj.put("tenantID", rShipVal);
- }
- }
- }
-
- JSONArray relatedTPropArray = (JSONArray) inner1Obj.get("related-to-property");
- if (relatedTPropArray != null) {
- Iterator i3 = relatedTPropArray.iterator();
-
- while (i3.hasNext()) {
- JSONObject inner3Obj = (JSONObject) i3.next();
-
- if (inner3Obj == null)
- continue;
-
- String propKey = checkForNull((String) inner3Obj.get("property-key"));
- String propVal = checkForNull((String) inner3Obj.get("property-value"));
- if (propKey.equalsIgnoreCase("tenant.tenant-name")) {
- tenantNewObj.put("tenantName", propVal);
- }
- }
- }
- bconvert = true;
- tenantArray.add(tenantNewObj);
- }
- }
-
- }
- }
- } catch (NullPointerException ex) {
-
-
- }
-
- if (bconvert)
- return tenantArray.toJSONString();
- else
- return "";
-
- }
-
- /**
- * Check for null.
- *
- * @param local the local
- * @return the string
- */
- private static String checkForNull(String local) {
- if (local != null)
- return local;
- else
- return "";
-
- }
-
- /**
- * Welcome method.
- *
- * @param request the request
- * @return ModelAndView The view
- */
- @RequestMapping(value = {"/subscriberSearch"}, method = RequestMethod.GET)
- public ModelAndView welcome(HttpServletRequest request) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== AaiController welcome start");
- return new ModelAndView(getViewName());
- }
-
- @RequestMapping(value = {"/aai_get_aic_zones"}, method = RequestMethod.GET)
- public ResponseEntity<String> getAicZones(HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZones controller start");
- AaiResponse response = aaiService.getAaiZones();
- return aaiResponseToResponseEntity(response);
- }
-
- @RequestMapping(value = {"/aai_get_aic_zone_for_pnf/{globalCustomerId}/{serviceType}/{serviceId}"}, method = RequestMethod.GET)
- public ResponseEntity<String> getAicZoneForPnf(@PathVariable("globalCustomerId") String globalCustomerId ,@PathVariable("serviceType") String serviceType , @PathVariable("serviceId") String serviceId ,HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZoneForPnf controller start");
- AaiResponse response = aaiService.getAicZoneForPnf(globalCustomerId , serviceType , serviceId);
- return aaiResponseToResponseEntity(response);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
- */
- public String getViewName() {
- return viewName;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
- */
- public void setViewName(String viewName) {
- this.viewName = viewName;
- }
-
- /**
- * Get services from a&ai.
- *
- * @return ResponseEntity<String> The response entity with the logged in user uuid.
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = {"/getuserID"}, method = RequestMethod.GET)
- public ResponseEntity<String> getUserID(HttpServletRequest request) throws IOException, InterruptedException {
-
- String userId = "";
- HttpSession session = request.getSession();
- if (session != null) {
- User user = (User) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
- if (user != null) {
- //userId = user.getHrid();
- userId = user.getLoginId();
- if (userId == null)
- userId = user.getOrgUserId();
- }
- }
-
- return new ResponseEntity<String>(userId, HttpStatus.OK);
- }
-
- /**
- * Get services from a&ai.
- *
- * @return ResponseEntity<String> The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = "/aai_get_services", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> doGetServices(HttpServletRequest request) throws IOException, InterruptedException {
-
- RoleValidator roleValidator = new RoleValidator(new RoleProvider().getUserRoles(request));
-
- AaiResponse subscriberList = aaiService.getServices(roleValidator);
- ResponseEntity<String> responseEntity = aaiResponseToResponseEntity(subscriberList);
-
- return responseEntity;
- }
-
-
- @RequestMapping(value = {"/aai_get_version_by_invariant_id"}, method = RequestMethod.POST)
- public ResponseEntity<String> getVersionByInvariantId(HttpServletRequest request, @RequestBody VersionByInvariantIdsRequest versions) throws IOException {
- ResponseEntity<String> responseEntity;
- ObjectMapper objectMapper = new ObjectMapper();
-
- Response result = aaiService.getVersionByInvariantId(versions.versions);
-
- return new ResponseEntity<String>(result.readEntity(String.class), HttpStatus.OK);
- }
-
-
- private ResponseEntity<String> aaiResponseToResponseEntity(AaiResponse aaiResponseData)
- throws IOException, JsonGenerationException, JsonMappingException {
- ResponseEntity<String> responseEntity;
- ObjectMapper objectMapper = new ObjectMapper();
- if (aaiResponseData.getHttpCode() == 200) {
- responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(aaiResponseData.getT()), HttpStatus.OK);
- } else {
- responseEntity = new ResponseEntity<String>(aaiResponseData.getErrorMessage(), HttpStatus.valueOf(aaiResponseData.getHttpCode()));
- }
- return responseEntity;
- }
-
- /**
- * Lookup single service instance in a&ai. Get the service-subscription and customer, too, i guess?
- *
- * @param serviceInstanceId the service instance Id
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = "/aai_get_service_instance/{service-instance-id}/{service-instance-type}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> doGetServiceInstance(@PathVariable("service-instance-id") String serviceInstanceId, @PathVariable("service-instance-type") String serviceInstanceType) throws IOException, InterruptedException {
- File certiPath = GetCertificatesPath();
- Response resp = null;
-
- if (serviceInstanceType.equalsIgnoreCase("Service Instance Id")) {
- resp = doAaiGet(certiPath.getAbsolutePath(),
- "search/nodes-query?search-node-type=service-instance&filter=service-instance-id:EQUALS:"
- + serviceInstanceId, false);
- } else {
- resp = doAaiGet(certiPath.getAbsolutePath(),
- "search/nodes-query?search-node-type=service-instance&filter=service-instance-name:EQUALS:"
- + serviceInstanceId, false);
- }
- return convertResponseToResponseEntity(resp);
- }
-
- /**
- * Get services from a&ai.
- *
- * @param globalCustomerId the global customer id
- * @param serviceSubscriptionId the service subscription id
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = "/aai_get_service_subscription/{global-customer-id}/{service-subscription-id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> doGetServices(@PathVariable("global-customer-id") String globalCustomerId,
- @PathVariable("service-subscription-id") String serviceSubscriptionId) throws IOException, InterruptedException {
- File certiPath = GetCertificatesPath();
- Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + globalCustomerId
- + "/service-subscriptions/service-subscription/" + serviceSubscriptionId + "?depth=0", false);
- return convertResponseToResponseEntity(resp);
- }
-
- /**
- * Obtain the subscriber list from a&ai.
- *
- * @param fullSet the full set
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = "/aai_get_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> doGetSubscriberList(HttpServletRequest request, @DefaultValue("n") @QueryParam("fullSet") String fullSet) throws IOException, InterruptedException {
- return getFullSubscriberList(request);
- }
-
- /**
- * Obtain the Target Prov Status from the System.Properties file.
- *
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = "/get_system_prop_vnf_prov_status", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> getTargetProvStatus() throws IOException, InterruptedException {
- String p = SystemProperties.getProperty("aai.vnf.provstatus");
- return new ResponseEntity<String>(p, HttpStatus.OK);
- }
-
- /**
- * Obtain the full subscriber list from a&ai.
- * <p>
- * g @return ResponseEntity The response entity
- *
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value = "/aai_get_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> getFullSubscriberList(HttpServletRequest request) throws IOException, InterruptedException {
- ObjectMapper objectMapper = new ObjectMapper();
- ResponseEntity<String> responseEntity;
- RoleValidator roleValidator = new RoleValidator(new RoleProvider().getUserRoles(request));
- SubscriberFilteredResults subscriberList = aaiService.getFullSubscriberList(roleValidator);
- if (subscriberList.getHttpCode() == 200) {
- responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(subscriberList.getSubscriberList()), HttpStatus.OK);
- } else {
- responseEntity = new ResponseEntity<String>(subscriberList.getErrorMessage(), HttpStatus.valueOf(subscriberList.getHttpCode()));
- }
-
-
- return responseEntity;
- }
-
-
- @RequestMapping(value = "/get_vnf_data_by_globalid_and_service_type/{globalCustomerId}/{serviceType}",
- method = RequestMethod.GET,
- produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> getVnfDataByGlobalIdAndServiceType(HttpServletRequest request,
- @PathVariable("globalCustomerId") String globalCustomerId,
- @PathVariable("serviceType") String serviceType) throws IOException {
-
- Response resp = aaiService.getVNFData(globalCustomerId, serviceType);
- return convertResponseToResponseEntity(resp);
- }
-
-
- /**
- * Refresh the subscriber list from a&ai.
- *
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- */
- @RequestMapping(value = "/aai_refresh_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> doRefreshSubscriberList() throws IOException {
- Response resp = getSubscribers(false);
- return convertResponseToResponseEntity(resp);
- }
-
- /**
- * Refresh the full subscriber list from a&ai.
- *
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- */
- @RequestMapping(value = "/aai_refresh_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public ResponseEntity<String> doRefreshFullSubscriberList() throws IOException {
- Response resp = getSubscribers(false);
- return convertResponseToResponseEntity(resp);
- }
-
- /**
- * Get subscriber details from a&ai.
- *
- * @param subscriberId the subscriber id
- * @return ResponseEntity The response entity
- */
- @RequestMapping(value = "/aai_sub_details/{subscriberId}", method = RequestMethod.GET)
- public ResponseEntity<String> GetSubscriberDetails(HttpServletRequest request, @PathVariable("subscriberId") String subscriberId) throws IOException {
- ObjectMapper objectMapper = new ObjectMapper();
- ResponseEntity responseEntity;
- List<Role> roles = new RoleProvider().getUserRoles(request);
- RoleValidator roleValidator = new RoleValidator(roles);
- AaiResponse<SubscriberData> subscriberData = aaiService.getSubscriberData(subscriberId, roleValidator);
- String httpMessage = subscriberData.getT() != null ?
- objectMapper.writeValueAsString(subscriberData.getT()) :
- subscriberData.getErrorMessage();
-
- responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.valueOf(subscriberData.getHttpCode()));
- return responseEntity;
- }
-
- /**
- * Issue a named query to a&ai.
- *
- * @param namedQueryId the named query id
- * @param globalCustomerId the global customer id
- * @param serviceType the service type
- * @param serviceInstance the service instance
- * @return ResponseEntity The response entity
- */
- @RequestMapping(value = "/aai_sub_viewedit/{namedQueryId}/{globalCustomerId}/{serviceType}/{serviceInstance}", method = RequestMethod.GET)
- public ResponseEntity<String> viewEditGetComponentList(
- @PathVariable("namedQueryId") String namedQueryId,
- @PathVariable("globalCustomerId") String globalCustomerId,
- @PathVariable("serviceType") String serviceType,
- @PathVariable("serviceInstance") String serviceInstance) {
-
- String componentListPayload = getComponentListPutPayload(namedQueryId, globalCustomerId, serviceType, serviceInstance);
- File certiPath = GetCertificatesPath();
-
- Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
- return convertResponseToResponseEntity(resp);
- }
-
-
- @RequestMapping(value = "/aai_get_vnf_data/{globalCustomerId}/{serviceType}/{serviceInstanceId}", method = RequestMethod.GET)
- public AaiResponse<String> getVnfData(
- @PathVariable("globalCustomerId") String globalCustomerId,
- @PathVariable("serviceType") String serviceType,
- @PathVariable("serviceInstanceId") String serviceInstanceId) {
-
- return aaiService.getVNFData(globalCustomerId, serviceType, serviceInstanceId);
-
- }
-
-
- // @RequestMapping(value="/aai_get_tenants/{global-customer-id}", method = RequestMethod.GET)
- // public ResponseEntity<String> viewEditGetComponentList(
- // @PathVariable("global-customer-id") String globalCustomerId) {
- // return new ResponseEntity<String>(getTenants(globalCustomerId), HttpStatus.OK);
- // }
-
- /**
- * Issue a named query to a&ai.
- *
- * @param namedQueryId the named query id
- * @param globalCustomerId the global customer id
- * @param serviceType the service type
- * @return ResponseEntity The response entity
- */
- @RequestMapping(value = "/aai_get_models_by_service_type/{namedQueryId}/{globalCustomerId}/{serviceType}", method = RequestMethod.GET)
- public ResponseEntity<String> viewEditGetComponentList(
- @PathVariable("namedQueryId") String namedQueryId,
- @PathVariable("globalCustomerId") String globalCustomerId,
- @PathVariable("serviceType") String serviceType) {
-
- String componentListPayload = getModelsByServiceTypePayload(namedQueryId, globalCustomerId, serviceType);
- File certiPath = GetCertificatesPath();
-
- Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
- return convertResponseToResponseEntity(resp);
- }
-
- /**
- * Parses the for tenants.
- *
- * @param resp the resp
- * @return the string
- */
- private String parseForTenants(String resp) {
- String tenantList = "";
-
- try {
- JSONParser jsonParser = new JSONParser();
-
- JSONObject jsonObject = (JSONObject) jsonParser.parse(resp);
-
- return parseCustomerObjectForTenants(jsonObject);
- } catch (Exception ex) {
-
- }
-
- return tenantList;
- }
-
- /**
- * Parses the for tenants by service subscription.
- *
- * @param resp the resp
- * @return the string
- */
- private String parseForTenantsByServiceSubscription(String resp) {
- String tenantList = "";
-
- try {
- JSONParser jsonParser = new JSONParser();
-
- JSONObject jsonObject = (JSONObject) jsonParser.parse(resp);
-
- return parseServiceSubscriptionObjectForTenants(jsonObject);
- } catch (Exception ex) {
-
- }
-
- return tenantList;
- }
-
- /**
- * Obtain tenants for a given service type.
- *
- * @param globalCustomerId the global customer id
- * @param serviceType the service type
- * @return ResponseEntity The response entity
- */
- @RequestMapping(value = "/aai_get_tenants/{global-customer-id}/{service-type}", method = RequestMethod.GET)
- public ResponseEntity<String> viewEditGetTenantsFromServiceType(HttpServletRequest request,
- @PathVariable("global-customer-id") String globalCustomerId, @PathVariable("service-type") String serviceType) {
-
- ResponseEntity responseEntity;
- try {
- ObjectMapper objectMapper = new ObjectMapper();
- List<Role> roles = new RoleProvider().getUserRoles(request);
- RoleValidator roleValidator = new RoleValidator(roles);
- AaiResponse<GetTenantsResponse[]> response = aaiService.getTenants(globalCustomerId, serviceType, roleValidator);
- if (response.getHttpCode() == 200) {
- responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(response.getT()), HttpStatus.OK);
- } else {
- responseEntity = new ResponseEntity<String>(response.getErrorMessage(), HttpStatus.valueOf(response.getHttpCode()));
- }
- } catch (Exception e) {
- responseEntity = new ResponseEntity<String>("Unable to proccess getTenants reponse", HttpStatus.INTERNAL_SERVER_ERROR);
- }
- return responseEntity;
- }
-
-
- private ResponseEntity<String> convertResponseToResponseEntity(Response resp) {
- ResponseEntity<String> respEnt;
- ObjectMapper objectMapper = new ObjectMapper();
- if (resp == null) {
- respEnt = new ResponseEntity<String>("Failed to fetch data from A&AI, check server logs for details.", HttpStatus.INTERNAL_SERVER_ERROR);
- } else {
- respEnt = new ResponseEntity<String>(resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
- }
- return respEnt;
- }
-
- /**
- * Gets the tenants.
- *
- * @param globalCustomerId the global customer id
- * @return the tenants
- */
- private ResponseEntity<String> getTenants(String globalCustomerId) {
- File certiPath = GetCertificatesPath();
- Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + globalCustomerId, false);
-
- ResponseEntity<String> respEnt;
- if (resp.getStatus() >= 200 && resp.getStatus() <= 299) {
- respEnt = new ResponseEntity<String>(parseForTenants((String) resp.readEntity(String.class)), HttpStatus.OK);
- } else {
- respEnt = new ResponseEntity<String>((String) resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
- }
- return respEnt;
-
- }
-
- /**
- * Gets the tenants from service type.
- *
- * @param globalCustomerId the global customer id
- * @param serviceType the service type
- * @return the tenants from service type
- */
- private ResponseEntity<String> getTenantsFromServiceType(String globalCustomerId, String serviceType) {
-
-
- File certiPath = GetCertificatesPath();
- String url = "business/customers/customer/" + globalCustomerId + "/service-subscriptions/service-subscription/" + serviceType;
-
- Response resp = doAaiGet(certiPath.getAbsolutePath(), url, false);
-
- ResponseEntity<String> respEnt;
- if (resp.getStatus() >= 200 && resp.getStatus() <= 299) {
- respEnt = new ResponseEntity<String>(parseForTenantsByServiceSubscription((String) resp.readEntity(String.class)), HttpStatus.OK);
- } else {
- respEnt = new ResponseEntity<String>((String) resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
- }
- return respEnt;
-
- }
-
- /**
- * Gets the services.
- *
- * @return the services
- */
- private Response getServices() {
- File certiPath = GetCertificatesPath();
- Response resp = doAaiGet(certiPath.getAbsolutePath(), "service-design-and-creation/services", false);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getServices() resp=" + resp.getStatusInfo());
-
- //model.put("aai_get_services", resp);
- return resp;
- }
-
- /**
- * Gets the subscribers.
- *
- * @param isFullSet the is full set
- * @return the subscribers
- */
- private Response getSubscribers(boolean isFullSet) {
-
- File certiPath = GetCertificatesPath();
- String depth = "0";
-
- Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers?subscriber-type=INFRA&depth=" + depth, false);
- if (resp != null) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscribers() resp=" + resp.getStatusInfo().toString());
- }
- return resp;
- }
-
- /**
- * Gets the subscriber details.
- *
- * @param subscriberId the subscriber id
- * @return the subscriber details
- */
- private Response getSubscriberDetails(String subscriberId) {
- File certiPath = GetCertificatesPath();
- Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId + "?depth=2", false);
- //String resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId, false);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscriberDetails() resp=" + resp.getStatusInfo().toString());
- return resp;
- }
-
- /**
- * Gets the certificates path.
- *
- * @return the file
- */
- private File GetCertificatesPath() {
- if (servletContext != null)
- return new File(servletContext.getRealPath("/WEB-INF/cert/"));
- return null;
- }
-
- /**
- * Send a GET request to a&ai.
- *
- * @param certiPath the certi path
- * @param uri the uri
- * @param xml the xml
- * @return String The response
- */
- protected Response doAaiGet(String certiPath, String uri, boolean xml) {
- String methodName = "getSubscriberList";
- String transId = UUID.randomUUID().toString();
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- Response resp = null;
- try {
-
- AAIRestInterface restContrller = new AAIRestInterface(certiPath);
- resp = restContrller.RestGet(fromAppId, transId, uri, xml);
-
- } catch (WebApplicationException e) {
- final String message = ((BadRequestException) e).getResponse().readEntity(String.class);
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
- } catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- }
-
- return resp;
- }
-
- /**
- * Send a POST request to a&ai.
- *
- * @param certiPath the certi path
- * @param uri the uri
- * @param payload the payload
- * @param xml the xml
- * @return String The response
- */
- protected Response doAaiPost(String certiPath, String uri, String payload, boolean xml) {
- String methodName = "getSubscriberList";
- String transId = UUID.randomUUID().toString();
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- Response resp = null;
- try {
-
- AAIRestInterface restContrller = new AAIRestInterface(certiPath);
- resp = restContrller.RestPost(fromAppId, transId, uri, payload, xml);
-
- } catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- }
-
- return resp;
- }
-
- /**
- * Gets the component list put payload.
- *
- * @param namedQueryId the named query id
- * @param globalCustomerId the global customer id
- * @param serviceType the service type
- * @param serviceInstance the service instance
- * @return the component list put payload
- */
- private String getComponentListPutPayload(String namedQueryId, String globalCustomerId, String serviceType, String serviceInstance) {
- return
- " {" +
- " \"instance-filters\": {" +
- " \"instance-filter\": [" +
- " {" +
- " \"customer\": {" +
- " \"global-customer-id\": \"" + globalCustomerId + "\"" +
- " }," +
- " \"service-instance\": {" +
- " \"service-instance-id\": \"" + serviceInstance + "\"" +
- " }," +
- " \"service-subscription\": {" +
- " \"service-type\": \"" + serviceType + "\"" +
- " }" +
- " }" +
- " ]" +
- " }," +
- " \"query-parameters\": {" +
- " \"named-query\": {" +
- " \"named-query-uuid\": \"" + namedQueryId + "\"" +
- " }" +
- " }" +
- "}";
-
- }
-
- private String getModelsByServiceTypePayload(String namedQueryId, String globalCustomerId, String serviceType) {
- // TODO Auto-generated method stub
- return " {" +
- " \"instance-filters\": {" +
- " \"instance-filter\": [" +
- " {" +
- " \"customer\": {" +
- " \"global-customer-id\": \"" + globalCustomerId + "\"" +
- " }," +
- " \"service-subscription\": {" +
- " \"service-type\": \"" + serviceType + "\"" +
- " }" +
- " }" +
- " ]" +
- " }," +
- " \"query-parameters\": {" +
- " \"named-query\": {" +
- " \"named-query-uuid\": \"" + namedQueryId + "\"" +
- " }" +
- " }" +
- "}";
-
- }
-}
-
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.codehaus.jackson.JsonGenerationException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.ServiceInstancesSearchResults;
+import org.onap.vid.aai.SubscriberData;
+import org.onap.vid.aai.SubscriberFilteredResults;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.aai.util.AAIRestInterface;
+import org.onap.vid.model.VersionByInvariantIdsRequest;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.services.AaiService;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.HandlerMapping;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.BadRequestException;
+import javax.ws.rs.DefaultValue;
+import javax.ws.rs.QueryParam;
+import javax.ws.rs.WebApplicationException;
+import javax.ws.rs.core.Response;
+import java.io.File;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * Controller to handle a&ai requests.
+ */
+
+@RestController
+public class
+AaiController extends RestrictedBaseController {
+ /**
+ * The Constant dateFormat.
+ */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+ /**
+ * The from app id.
+ */
+ protected String fromAppId = "VidAaiController";
+ /**
+ * The logger.
+ */
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(AaiController.class);
+ /**
+ * The model.
+ */
+ private Map<String, Object> model = new HashMap<String, Object>();
+ /**
+ * The servlet context.
+ */
+ @Autowired
+ private ServletContext servletContext;
+ /**
+ * aai service
+ */
+ @Autowired
+ private AaiService aaiService;
+ @Autowired
+ private RoleProvider roleProvider;
+
+ public AaiController() {
+
+ }
+
+ public AaiController(ServletContext servletContext) {
+ this.servletContext = servletContext;
+
+ }
+
+ /**
+ * Welcome method.
+ *
+ * @param request the request
+ * @return ModelAndView The view
+ */
+ @RequestMapping(value = {"/subscriberSearch"}, method = RequestMethod.GET)
+ public ModelAndView welcome(HttpServletRequest request) {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== AaiController welcome start");
+ return new ModelAndView(getViewName());
+ }
+
+ @RequestMapping(value = {"/aai_get_aic_zones"}, method = RequestMethod.GET)
+ public ResponseEntity<String> getAicZones(HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZones controller start");
+ AaiResponse response = aaiService.getAaiZones();
+ return aaiResponseToResponseEntity(response);
+ }
+
+ @RequestMapping(value = {"/aai_get_aic_zone_for_pnf/{globalCustomerId}/{serviceType}/{serviceId}"}, method = RequestMethod.GET)
+ public ResponseEntity<String> getAicZoneForPnf(@PathVariable("globalCustomerId") String globalCustomerId ,@PathVariable("serviceType") String serviceType , @PathVariable("serviceId") String serviceId ,HttpServletRequest request) throws JsonGenerationException, JsonMappingException, IOException {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== getAicZoneForPnf controller start");
+ AaiResponse response = aaiService.getAicZoneForPnf(globalCustomerId , serviceType , serviceId);
+ return aaiResponseToResponseEntity(response);
+ }
+
+ /**
+ * Get services from a&ai.
+ *
+ * @return ResponseEntity<String> The response entity with the logged in user uuid.
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = {"/getuserID"}, method = RequestMethod.GET)
+ public ResponseEntity<String> getUserID(HttpServletRequest request) throws IOException, InterruptedException {
+
+ String userId = ControllersUtils.extractUserId(request);
+
+ return new ResponseEntity<String>(userId, HttpStatus.OK);
+ }
+
+ /**
+ * Get services from a&ai.
+ *
+ * @return ResponseEntity<String> The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/aai_get_services", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> doGetServices(HttpServletRequest request) throws IOException, InterruptedException {
+ RoleValidator roleValidator = new RoleValidator(roleProvider.getUserRoles(request));
+
+ AaiResponse subscriberList = aaiService.getServices(roleValidator);
+ ResponseEntity<String> responseEntity = aaiResponseToResponseEntity(subscriberList);
+
+ return responseEntity;
+ }
+
+
+ @RequestMapping(value = {"/aai_get_version_by_invariant_id"}, method = RequestMethod.POST)
+ public ResponseEntity<String> getVersionByInvariantId(HttpServletRequest request, @RequestBody VersionByInvariantIdsRequest versions) throws IOException {
+ ResponseEntity<String> responseEntity;
+ ObjectMapper objectMapper = new ObjectMapper();
+
+ Response result = aaiService.getVersionByInvariantId(versions.versions);
+
+ return new ResponseEntity<String>(result.readEntity(String.class), HttpStatus.OK);
+ }
+
+
+ private ResponseEntity<String> aaiResponseToResponseEntity(AaiResponse aaiResponseData)
+ throws IOException, JsonGenerationException, JsonMappingException {
+ ResponseEntity<String> responseEntity;
+ ObjectMapper objectMapper = new ObjectMapper();
+ if (aaiResponseData.getHttpCode() == 200) {
+ responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(aaiResponseData.getT()), HttpStatus.OK);
+ } else {
+ responseEntity = new ResponseEntity<String>(aaiResponseData.getErrorMessage(), HttpStatus.valueOf(aaiResponseData.getHttpCode()));
+ }
+ return responseEntity;
+ }
+
+ /**
+ * Lookup single service instance in a&ai. Get the service-subscription and customer, too, i guess?
+ *
+ * @param serviceInstanceId the service instance Id
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/aai_get_service_instance/{service-instance-id}/{service-instance-type}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> doGetServiceInstance(@PathVariable("service-instance-id") String serviceInstanceId, @PathVariable("service-instance-type") String serviceInstanceType) throws IOException, InterruptedException {
+ File certiPath = GetCertificatesPath();
+ Response resp = null;
+
+ if (serviceInstanceType.equalsIgnoreCase("Service Instance Id")) {
+ resp = doAaiGet(certiPath.getAbsolutePath(),
+ "search/nodes-query?search-node-type=service-instance&filter=service-instance-id:EQUALS:"
+ + serviceInstanceId, false);
+ } else {
+ resp = doAaiGet(certiPath.getAbsolutePath(),
+ "search/nodes-query?search-node-type=service-instance&filter=service-instance-name:EQUALS:"
+ + serviceInstanceId, false);
+ }
+ return convertResponseToResponseEntity(resp);
+ }
+
+ /**
+ * Get services from a&ai.
+ *
+ * @param globalCustomerId the global customer id
+ * @param serviceSubscriptionId the service subscription id
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/aai_get_service_subscription/{global-customer-id}/{service-subscription-id}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> doGetServices(@PathVariable("global-customer-id") String globalCustomerId,
+ @PathVariable("service-subscription-id") String serviceSubscriptionId) throws IOException, InterruptedException {
+ File certiPath = GetCertificatesPath();
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + globalCustomerId
+ + "/service-subscriptions/service-subscription/" + serviceSubscriptionId + "?depth=0", false);
+ return convertResponseToResponseEntity(resp);
+ }
+
+ /**
+ * Obtain the subscriber list from a&ai.
+ *
+ * @param fullSet the full set
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/aai_get_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> doGetSubscriberList(HttpServletRequest request, @DefaultValue("n") @QueryParam("fullSet") String fullSet) throws IOException, InterruptedException {
+ return getFullSubscriberList(request);
+ }
+
+ /**
+ * Obtain the Target Prov Status from the System.Properties file.
+ *
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/get_system_prop_vnf_prov_status", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> getTargetProvStatus() throws IOException, InterruptedException {
+ String p = SystemProperties.getProperty("aai.vnf.provstatus");
+ return new ResponseEntity<String>(p, HttpStatus.OK);
+ }
+
+
+ /**
+ * Obtain the Target Prov Status from the System.Properties file.
+ *
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/get_operational_environments", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(@RequestParam(value="operationalEnvironmentType", required = false) String operationalEnvironmentType,
+ @RequestParam(value="operationalEnvironmentStatus", required = false) String operationalEnvironmentStatus) throws IOException, InterruptedException {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({}, {})", getMethodName(), operationalEnvironmentType, operationalEnvironmentStatus);
+ AaiResponse<OperationalEnvironmentList> response = aaiService.getOperationalEnvironments(operationalEnvironmentType,operationalEnvironmentStatus);
+ if (response.getHttpCode() != 200) {
+ String errorMessage = getAaiErrorMessage(response.getErrorMessage());
+ if(errorMessage != null) {
+ response = new AaiResponse<OperationalEnvironmentList>(response.getT(), errorMessage, response.getHttpCode());
+ }
+ }
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+ return response;
+ }
+
+ /**
+ * Obtain the full subscriber list from a&ai.
+ * <p>
+ * g @return ResponseEntity The response entity
+ *
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value = "/aai_get_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> getFullSubscriberList(HttpServletRequest request) throws IOException, InterruptedException {
+ ObjectMapper objectMapper = new ObjectMapper();
+ ResponseEntity<String> responseEntity;
+ RoleValidator roleValidator = new RoleValidator(roleProvider.getUserRoles(request));
+ SubscriberFilteredResults subscriberList = aaiService.getFullSubscriberList(roleValidator);
+ if (subscriberList.getHttpCode() == 200) {
+ responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(subscriberList.getSubscriberList()), HttpStatus.OK);
+ } else {
+ responseEntity = new ResponseEntity<String>(subscriberList.getErrorMessage(), HttpStatus.valueOf(subscriberList.getHttpCode()));
+ }
+
+
+ return responseEntity;
+ }
+
+
+ @RequestMapping(value = "/get_vnf_data_by_globalid_and_service_type/{globalCustomerId}/{serviceType}",
+ method = RequestMethod.GET,
+ produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> getVnfDataByGlobalIdAndServiceType(HttpServletRequest request,
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType) throws IOException {
+
+ Response resp = aaiService.getVNFData(globalCustomerId, serviceType);
+ return convertResponseToResponseEntity(resp);
+ }
+
+
+ /**
+ * Refresh the subscriber list from a&ai.
+ *
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @RequestMapping(value = "/aai_refresh_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> doRefreshSubscriberList() throws IOException {
+ Response resp = getSubscribers(false);
+ return convertResponseToResponseEntity(resp);
+ }
+
+ /**
+ * Refresh the full subscriber list from a&ai.
+ *
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @RequestMapping(value = "/aai_refresh_full_subscribers", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public ResponseEntity<String> doRefreshFullSubscriberList() throws IOException {
+ Response resp = getSubscribers(false);
+ return convertResponseToResponseEntity(resp);
+ }
+
+ /**
+ * Get subscriber details from a&ai.
+ *
+ * @param subscriberId the subscriber id
+ * @return ResponseEntity The response entity
+ */
+ @RequestMapping(value = "/aai_sub_details/{subscriberId}", method = RequestMethod.GET)
+ public ResponseEntity<String> GetSubscriberDetails(HttpServletRequest request, @PathVariable("subscriberId") String subscriberId) throws IOException {
+ ObjectMapper objectMapper = new ObjectMapper();
+ ResponseEntity responseEntity;
+ List<Role> roles = roleProvider.getUserRoles(request);
+ RoleValidator roleValidator = new RoleValidator(roles);
+ AaiResponse<SubscriberData> subscriberData = aaiService.getSubscriberData(subscriberId, roleValidator);
+ String httpMessage = subscriberData.getT() != null ?
+ objectMapper.writeValueAsString(subscriberData.getT()) :
+ subscriberData.getErrorMessage();
+
+ responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.valueOf(subscriberData.getHttpCode()));
+ return responseEntity;
+ }
+
+ /**
+ * Get service instances that match the query from a&ai.
+ *
+ * @param subscriberId the subscriber id
+ * @param instanceIdentifier the service instance name or id.
+ * @param projects the projects that are related to the instance
+ * @param owningEntities the owningEntities that are related to the instance
+ * @return ResponseEntity The response entity
+ */
+ @RequestMapping(value = "/search_service_instances", method = RequestMethod.GET)
+ public ResponseEntity<String> SearchServiceInstances(HttpServletRequest request,
+ @RequestParam(value="subscriberId", required = false) String subscriberId,
+ @RequestParam(value="serviceInstanceIdentifier", required = false) String instanceIdentifier,
+ @RequestParam(value="project", required = false) List<String> projects,
+ @RequestParam(value="owningEntity", required = false) List<String> owningEntities) throws IOException {
+ ObjectMapper objectMapper = new ObjectMapper();
+ ResponseEntity responseEntity;
+
+ List<Role> roles = roleProvider.getUserRoles(request);
+ RoleValidator roleValidator = new RoleValidator(roles);
+
+ AaiResponse<ServiceInstancesSearchResults> searchResult = aaiService.getServiceInstanceSearchResults(subscriberId, instanceIdentifier, roleValidator, owningEntities, projects);
+
+ String httpMessage = searchResult.getT() != null ?
+ objectMapper.writeValueAsString(searchResult.getT()) :
+ searchResult.getErrorMessage();
+
+
+ if(searchResult.getT().serviceInstances.size() == 0){
+ responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.NOT_FOUND);
+
+ } else {
+ responseEntity = new ResponseEntity<String>(httpMessage, HttpStatus.valueOf(searchResult.getHttpCode()));
+
+ }
+ return responseEntity;
+ }
+
+
+
+ /**
+ * Issue a named query to a&ai.
+ *
+ * @param namedQueryId the named query id
+ * @param globalCustomerId the global customer id
+ * @param serviceType the service type
+ * @param serviceInstance the service instance
+ * @return ResponseEntity The response entity
+ */
+ @RequestMapping(value = "/aai_sub_viewedit/{namedQueryId}/{globalCustomerId}/{serviceType}/{serviceInstance}", method = RequestMethod.GET)
+ public ResponseEntity<String> viewEditGetComponentList(
+ @PathVariable("namedQueryId") String namedQueryId,
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType,
+ @PathVariable("serviceInstance") String serviceInstance) {
+
+ String componentListPayload = getComponentListPutPayload(namedQueryId, globalCustomerId, serviceType, serviceInstance);
+ File certiPath = GetCertificatesPath();
+
+ Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
+ return convertResponseToResponseEntity(resp);
+ }
+
+ @RequestMapping(value = "/aai_get_vnf_data/{globalCustomerId}/{serviceType}/{serviceInstanceId}", method = RequestMethod.GET)
+ public AaiResponse<String> getVnfData(
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType,
+ @PathVariable("serviceInstanceId") String serviceInstanceId) {
+
+ return aaiService.getVNFData(globalCustomerId, serviceType, serviceInstanceId);
+
+ }
+
+
+ /**
+ * Issue a named query to a&ai.
+ *
+ * @param namedQueryId the named query id
+ * @param globalCustomerId the global customer id
+ * @param serviceType the service type
+ * @return ResponseEntity The response entity
+ */
+ @RequestMapping(value = "/aai_get_models_by_service_type/{namedQueryId}/{globalCustomerId}/{serviceType}", method = RequestMethod.GET)
+ public ResponseEntity<String> viewEditGetComponentList(
+ @PathVariable("namedQueryId") String namedQueryId,
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType) {
+
+ String componentListPayload = getModelsByServiceTypePayload(namedQueryId, globalCustomerId, serviceType);
+ File certiPath = GetCertificatesPath();
+
+ Response resp = doAaiPost(certiPath.getAbsolutePath(), "search/named-query", componentListPayload, false);
+ return convertResponseToResponseEntity(resp);
+ }
+
+ @RequestMapping(value = "/aai_get_vnf_instances/{globalCustomerId}/{serviceType}/{modelVersionId}/{modelInvariantId}/{cloudRegion}", method = RequestMethod.GET)
+ public ResponseEntity<String> getNodeTemplateInstances(
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType,
+ @PathVariable("modelVersionId") String modelVersionId,
+ @PathVariable("modelInvariantId") String modelInvariantId,
+ @PathVariable("cloudRegion") String cloudRegion) {
+
+ AaiResponse<String> resp = aaiService.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion);
+ return new ResponseEntity<String>(resp.getT(), HttpStatus.valueOf(resp.getHttpCode()));
+ }
+
+ @RequestMapping(value = "/aai_get_by_uri/**", method = RequestMethod.GET)
+ public ResponseEntity<String> getByUri(HttpServletRequest request) {
+ File certiPath = GetCertificatesPath();
+
+ String restOfTheUrl = (String) request.getAttribute(
+ HandlerMapping.PATH_WITHIN_HANDLER_MAPPING_ATTRIBUTE);
+ String formattedUri = restOfTheUrl.replaceFirst("/aai_get_by_uri/", "").replaceFirst("^aai/v[\\d]+/", "");
+
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), formattedUri, false);
+
+ return convertResponseToResponseEntity(resp);
+ }
+
+ @RequestMapping(value = "/aai_get_configuration/{configuration_id}", method = RequestMethod.GET)
+ public ResponseEntity<String> getSpecificConfiguration(@PathVariable("configuration_id") String configurationId) {
+ File certiPath = GetCertificatesPath();
+
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), "network/configurations/configuration/"+configurationId, false);
+
+ return convertResponseToResponseEntity(resp);
+ }
+
+ @RequestMapping(value = "/aai_get_service_instance_pnfs/{globalCustomerId}/{serviceType}/{serviceInstanceId}", method = RequestMethod.GET)
+ public List<String> getServiceInstanceAssociatedPnfs(
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType,
+ @PathVariable("serviceInstanceId") String serviceInstanceId) {
+
+ return aaiService.getServiceInstanceAssociatedPnfs(globalCustomerId, serviceType, serviceInstanceId);
+ }
+
+ /**
+ * PNF section
+ */
+ @RequestMapping(value = "/aai_get_pnfs/pnf/{pnf_id}", method = RequestMethod.GET)
+ public ResponseEntity getSpecificPnf(@PathVariable("pnf_id") String pnfId) {
+ //logger.trace(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), pnfId);
+ AaiResponse<Pnf> resp;
+ ResponseEntity<Pnf> re;
+ try {
+ resp = aaiService.getSpecificPnf(pnfId);
+ re = new ResponseEntity<Pnf>(resp.getT(), HttpStatus.valueOf(resp.getHttpCode()));
+ } catch (Exception e){
+ return new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ //logger.trace(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), resp.getHttpCode());
+ return re;
+ }
+
+
+ /**
+ * Obtain tenants for a given service type.
+ *
+ * @param globalCustomerId the global customer id
+ * @param serviceType the service type
+ * @return ResponseEntity The response entity
+ */
+ @RequestMapping(value = "/aai_get_tenants/{global-customer-id}/{service-type}", method = RequestMethod.GET)
+ public ResponseEntity<String> viewEditGetTenantsFromServiceType(HttpServletRequest request,
+ @PathVariable("global-customer-id") String globalCustomerId, @PathVariable("service-type") String serviceType) {
+
+ ResponseEntity responseEntity;
+ try {
+ ObjectMapper objectMapper = new ObjectMapper();
+ List<Role> roles = roleProvider.getUserRoles(request);
+ RoleValidator roleValidator = new RoleValidator(roles);
+ AaiResponse<GetTenantsResponse[]> response = aaiService.getTenants(globalCustomerId, serviceType, roleValidator);
+ if (response.getHttpCode() == 200) {
+ responseEntity = new ResponseEntity<String>(objectMapper.writeValueAsString(response.getT()), HttpStatus.OK);
+ } else {
+ responseEntity = new ResponseEntity<String>(response.getErrorMessage(), HttpStatus.valueOf(response.getHttpCode()));
+ }
+ } catch (Exception e) {
+ responseEntity = new ResponseEntity<String>("Unable to proccess getTenants reponse", HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ return responseEntity;
+ }
+
+ @RequestMapping(value = "/aai_get_pnf_instances/{globalCustomerId}/{serviceType}/{modelVersionId}/{modelInvariantId}/{cloudRegion}/{equipVendor}/{equipModel}", method = RequestMethod.GET)
+ public ResponseEntity<String> getPnfInstances(
+ @PathVariable("globalCustomerId") String globalCustomerId,
+ @PathVariable("serviceType") String serviceType,
+ @PathVariable("modelVersionId") String modelVersionId,
+ @PathVariable("modelInvariantId") String modelInvariantId,
+ @PathVariable("cloudRegion") String cloudRegion,
+ @PathVariable("equipVendor") String equipVendor,
+ @PathVariable("equipModel") String equipModel) {
+
+ AaiResponse<String> resp = aaiService.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion, equipVendor, equipModel);
+ return new ResponseEntity<String>(resp.getT(), HttpStatus.valueOf(resp.getHttpCode()));
+ }
+
+ private ResponseEntity<String> convertResponseToResponseEntity(Response resp) {
+ ResponseEntity<String> respEnt;
+ ObjectMapper objectMapper = new ObjectMapper();
+ if (resp == null) {
+ respEnt = new ResponseEntity<String>("Failed to fetch data from A&AI, check server logs for details.", HttpStatus.INTERNAL_SERVER_ERROR);
+ } else {
+ respEnt = new ResponseEntity<String>(resp.readEntity(String.class), HttpStatus.valueOf(resp.getStatus()));
+ }
+ return respEnt;
+ }
+
+ /**
+ * Gets the subscribers.
+ *
+ * @param isFullSet the is full set
+ * @return the subscribers
+ */
+ private Response getSubscribers(boolean isFullSet) {
+
+ File certiPath = GetCertificatesPath();
+ String depth = "0";
+
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers?subscriber-type=INFRA&depth=" + depth, false);
+ if (resp != null) {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscribers() resp=" + resp.getStatusInfo().toString());
+ }
+ return resp;
+ }
+
+ /**
+ * Gets the subscriber details.
+ *
+ * @param subscriberId the subscriber id
+ * @return the subscriber details
+ */
+ private Response getSubscriberDetails(String subscriberId) {
+ File certiPath = GetCertificatesPath();
+ Response resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId + "?depth=2", false);
+ //String resp = doAaiGet(certiPath.getAbsolutePath(), "business/customers/customer/" + subscriberId, false);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "getSubscriberDetails() resp=" + resp.getStatusInfo().toString());
+ return resp;
+ }
+
+ /**
+ * Gets the certificates path.
+ *
+ * @return the file
+ */
+ private File GetCertificatesPath() {
+ if (servletContext != null)
+ return new File(servletContext.getRealPath("/WEB-INF/cert/"));
+ return null;
+ }
+
+ /**
+ * Send a GET request to a&ai.
+ *
+ * @param certiPath the certi path
+ * @param uri the uri
+ * @param xml the xml
+ * @return String The response
+ */
+ protected Response doAaiGet(String certiPath, String uri, boolean xml) {
+ String methodName = "getSubscriberList";
+ String transId = UUID.randomUUID().toString();
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ Response resp = null;
+ try {
+
+ AAIRestInterface restContrller = new AAIRestInterface(certiPath);
+ resp = restContrller.RestGet(fromAppId, transId, uri, xml);
+
+ } catch (WebApplicationException e) {
+ final String message = ((BadRequestException) e).getResponse().readEntity(String.class);
+ LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + message);
+ } catch (Exception e) {
+ LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ }
+
+ return resp;
+ }
+
+ /**
+ * Send a POST request to a&ai.
+ *
+ * @param certiPath the certi path
+ * @param uri the uri
+ * @param payload the payload
+ * @param xml the xml
+ * @return String The response
+ */
+ protected Response doAaiPost(String certiPath, String uri, String payload, boolean xml) {
+ String methodName = "getSubscriberList";
+ String transId = UUID.randomUUID().toString();
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ Response resp = null;
+ try {
+
+ AAIRestInterface restContrller = new AAIRestInterface(certiPath);
+ resp = restContrller.RestPost(fromAppId, transId, uri, payload, xml);
+
+ } catch (Exception e) {
+ LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ }
+
+ return resp;
+ }
+
+ /**
+ * Gets the component list put payload.
+ *
+ * @param namedQueryId the named query id
+ * @param globalCustomerId the global customer id
+ * @param serviceType the service type
+ * @param serviceInstance the service instance
+ * @return the component list put payload
+ */
+ private String getComponentListPutPayload(String namedQueryId, String globalCustomerId, String serviceType, String serviceInstance) {
+ return
+ " {" +
+ " \"instance-filters\": {" +
+ " \"instance-filter\": [" +
+ " {" +
+ " \"customer\": {" +
+ " \"global-customer-id\": \"" + globalCustomerId + "\"" +
+ " }," +
+ " \"service-instance\": {" +
+ " \"service-instance-id\": \"" + serviceInstance + "\"" +
+ " }," +
+ " \"service-subscription\": {" +
+ " \"service-type\": \"" + serviceType + "\"" +
+ " }" +
+ " }" +
+ " ]" +
+ " }," +
+ " \"query-parameters\": {" +
+ " \"named-query\": {" +
+ " \"named-query-uuid\": \"" + namedQueryId + "\"" +
+ " }" +
+ " }" +
+ "}";
+
+ }
+
+ private String getModelsByServiceTypePayload(String namedQueryId, String globalCustomerId, String serviceType) {
+ // TODO Auto-generated method stub
+ return " {" +
+ " \"instance-filters\": {" +
+ " \"instance-filter\": [" +
+ " {" +
+ " \"customer\": {" +
+ " \"global-customer-id\": \"" + globalCustomerId + "\"" +
+ " }," +
+ " \"service-subscription\": {" +
+ " \"service-type\": \"" + serviceType + "\"" +
+ " }" +
+ " }" +
+ " ]" +
+ " }," +
+ " \"query-parameters\": {" +
+ " \"named-query\": {" +
+ " \"named-query-uuid\": \"" + namedQueryId + "\"" +
+ " }" +
+ " }" +
+ "}";
+
+ }
+
+ private String getAaiErrorMessage(String message) {
+ try {
+ org.json.JSONObject json = new org.json.JSONObject(message);
+ json = json.getJSONObject("requestError").getJSONObject("serviceException");
+
+ return json.getString("messageId") + ": " + json.getString("text");
+
+ } catch (Exception e) {
+ return null;
+ }
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java b/vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java
new file mode 100644
index 000000000..4f307ed96
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ChangeManagementController.java
@@ -0,0 +1,193 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.apache.commons.lang3.tuple.Pair;
+import org.json.simple.JSONArray;
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.changeManagement.*;
+import org.onap.vid.exceptions.NotFoundException;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.model.MsoExceptionResponse;
+import org.onap.vid.mso.MsoResponseWrapper2;
+import org.onap.vid.mso.MsoResponseWrapperInterface;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.services.ChangeManagementService;
+import org.onap.vid.services.WorkflowService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.WebApplicationException;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Collections;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+import static org.springframework.http.HttpStatus.*;
+
+/**
+ * Controller to handle ChangeManagement feature requests.
+ */
+@RestController
+@RequestMapping(ChangeManagementController.CHANGE_MANAGEMENT)
+public class ChangeManagementController extends UnRestrictedBaseController {
+ private static final String GetWorkflowsResponse = null;
+ public static final String VNF_WORKFLOW_RELATION = "vnf_workflow_relation";
+ public static final String CHANGE_MANAGEMENT = "change-management";
+ public static final String GET_VNF_WORKFLOW_RELATION = "get_vnf_workflow_relation";
+ public static final String SCHEDULER_BY_SCHEDULE_ID = "/scheduler/schedules/{scheduleId}";
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(ChangeManagementController.class);
+ private String fromAppId;
+ private final WorkflowService workflowService;
+ private final ChangeManagementService changeManagementService;
+ private final ObjectMapper objectMapper;
+
+
+ @Autowired
+ public ChangeManagementController(WorkflowService workflowService, ChangeManagementService changeManagementService, ObjectMapper objectMapper) {
+ this.fromAppId = "VidChangeManagementController";
+ this.workflowService = workflowService;
+ this.changeManagementService = changeManagementService;
+ this.objectMapper = objectMapper;
+ }
+
+ @RequestMapping(value = {"/workflow"}, method = RequestMethod.GET)
+ public ResponseEntity<Collection<String>> getWorkflow(@RequestParam("vnfs") Collection<String> vnfs) throws IOException, InterruptedException {
+ Collection<String> result = this.workflowService.getWorkflowsForVNFs(vnfs);
+ return new ResponseEntity<>(result, OK);
+ }
+
+ @RequestMapping(value = {"/mso"}, method = RequestMethod.GET)
+ public ResponseEntity<Collection<Request>> getMSOChangeManagements() throws Exception, IOException, InterruptedException {
+
+ Collection<Request> result = this.changeManagementService.getMSOChangeManagements();
+ return new ResponseEntity<>(result, OK);
+ }
+
+ @RequestMapping(value = "/workflow/{vnfName}", method = RequestMethod.POST)
+ public ResponseEntity<String> changeManagement(@PathVariable("vnfName") String vnfName,
+ HttpServletRequest request,
+ @RequestBody ChangeManagementRequest changeManagmentRequest)
+ throws Exception {
+ return this.changeManagementService.doChangeManagement(changeManagmentRequest, vnfName);
+ }
+
+ @RequestMapping(value = "/uploadConfigUpdateFile", method = RequestMethod.POST)
+ public @ResponseBody ResponseEntity uploadConfigUpdateFile(@RequestPart("file") MultipartFile file)
+ throws Exception {
+ try {
+ String jsonString = this.changeManagementService.uploadConfigUpdateFile(file);
+ return new ResponseEntity<>(jsonString, HttpStatus.OK);
+ }
+ catch(WebApplicationException e){
+ return new ResponseEntity<>(handleException(e), HttpStatus.valueOf(e.getResponse().getStatus()));
+ }
+ catch (Exception e) {
+ return new ResponseEntity<>(handleException(e), INTERNAL_SERVER_ERROR);
+ }
+ }
+
+
+ @RequestMapping(value = {"/scheduler"}, method = RequestMethod.GET)
+ public ResponseEntity<JSONArray> getSchedulerChangeManagements() throws IOException, InterruptedException {
+ JSONArray result = this.changeManagementService.getSchedulerChangeManagements();
+ return new ResponseEntity<>(result, OK);
+ }
+
+ @RequestMapping(value = {SCHEDULER_BY_SCHEDULE_ID}, method = RequestMethod.DELETE)
+ public ResponseEntity deleteSchedule(@PathVariable("scheduleId") String scheduleId) throws IOException, InterruptedException {
+ Pair<String, Integer> result = this.changeManagementService.deleteSchedule(scheduleId);
+ return ResponseEntity.status(result.getRight()).build();
+ }
+
+
+ @RequestMapping(value = {GET_VNF_WORKFLOW_RELATION}, method = RequestMethod.POST)
+ public ResponseEntity getWorkflows(@RequestBody GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest) throws IOException, InterruptedException {
+ try {
+ GetWorkflowsResponse response = new GetWorkflowsResponse(changeManagementService.getWorkflowsForVnf(getVnfWorkflowRelationRequest));
+ return ResponseEntity.status(OK).body(response);
+ }
+ catch (NotFoundException exception) {
+ LOGGER.error(exception.getMessage(), exception);
+ return new ResponseEntity<>(new VnfWorkflowRelationResponse(Collections.singletonList(exception.getMessage())),HttpStatus.NOT_FOUND);
+ }
+ catch (Exception exception) {
+ return handleException(exception, "Failed to get workflows for vnf");
+ }
+ }
+
+ @RequestMapping(value = {VNF_WORKFLOW_RELATION}, method = RequestMethod.POST)
+ public ResponseEntity createWorkflowRelation(@RequestBody VnfWorkflowRelationRequest vnfWorkflowRelationRequest) throws IOException, InterruptedException {
+ VnfWorkflowRelationResponse vnfWorkflowRelationResponse;
+ try {
+ vnfWorkflowRelationResponse = changeManagementService.addVnfWorkflowRelation(vnfWorkflowRelationRequest);
+ }
+ catch (Exception exception) {
+ return handleException(exception, "Failed to add vnf to workflow relation");
+ }
+
+ return new ResponseEntity<>(vnfWorkflowRelationResponse, OK);
+ }
+
+ @RequestMapping(value = {VNF_WORKFLOW_RELATION}, method = RequestMethod.GET)
+ public ResponseEntity getAllWorkflowRelation() throws IOException, InterruptedException {
+
+ try {
+ VnfWorkflowRelationAllResponse vnfWorkflowRelationAllResponse = changeManagementService.getAllVnfWorkflowRelations();
+ return new ResponseEntity<>(vnfWorkflowRelationAllResponse, OK);
+ }
+ catch (Exception exception) {
+ return handleException(exception, "Failed to get all vnf to workflow relations");
+ }
+ }
+
+ @RequestMapping(value = {VNF_WORKFLOW_RELATION}, method = RequestMethod.DELETE)
+ public ResponseEntity deleteWorkflowRelation(@RequestBody VnfWorkflowRelationRequest vnfWorkflowRelationRequest) throws IOException, InterruptedException {
+ VnfWorkflowRelationResponse vnfWorkflowRelationResponse;
+ try {
+ vnfWorkflowRelationResponse = changeManagementService.deleteVnfWorkflowRelation(vnfWorkflowRelationRequest);
+ }
+ catch (Exception exception) {
+ return handleException(exception, "Failed to delete vnf from workflow relation");
+ }
+
+ return new ResponseEntity<>(vnfWorkflowRelationResponse, OK);
+ }
+
+ private ResponseEntity handleException(Exception exception, String msg) {
+ LOGGER.error(msg, exception);
+ return new ResponseEntity<>(new VnfWorkflowRelationResponse(Collections.singletonList(msg)), HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+
+
+ private ExceptionResponse handleException(Exception e) {
+ return ControllersUtils.handleException(e, LOGGER);
+ }
+
+ @ExceptionHandler(Exception.class)
+ @ResponseStatus(value=OK) //return 200 for Backwards compatibility with the previous responses to scheduler
+ private MsoResponseWrapperInterface exceptionHandler(Exception e) {
+ return exceptionHandler(e, INTERNAL_SERVER_ERROR);
+ }
+
+ @ExceptionHandler({
+ javax.ws.rs.BadRequestException.class,
+ })
+ @ResponseStatus(value = OK) //return 200 for Backwards compatibility with the previous responses to scheduler
+ public MsoResponseWrapperInterface clientDerivedExceptionAsBadRequest(Exception e) {
+ // same handler, different HTTP Code
+ return exceptionHandler(e, BAD_REQUEST);
+ }
+
+ private MsoResponseWrapperInterface exceptionHandler(Exception e, HttpStatus httpStatus) {
+ LOGGER.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e);
+ MsoResponseWrapper2<MsoExceptionResponse> responseWrapper2 = new MsoResponseWrapper2<>(httpStatus.value(), new MsoExceptionResponse(e));
+ return responseWrapper2;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java b/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java
new file mode 100644
index 000000000..1df4f42bc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ControllersUtils.java
@@ -0,0 +1,40 @@
+package org.onap.vid.controller;
+
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.openecomp.portalsdk.core.domain.User;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.model.ExceptionResponse;
+import org.slf4j.MDC;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+import static org.onap.vid.utils.Logging.getMethodName;
+
+public class ControllersUtils {
+
+
+ public static String extractUserId(HttpServletRequest request) {
+ String userId = "";
+ HttpSession session = request.getSession();
+ if (session != null) {
+ User user = (User) session.getAttribute(SystemProperties.getProperty(SystemProperties.USER_ATTRIBUTE_NAME));
+ if (user != null) {
+ //userId = user.getHrid();
+ userId = user.getLoginId();
+ if (userId == null)
+ userId = user.getOrgUserId();
+ }
+ }
+ return userId;
+ }
+
+ public static ExceptionResponse handleException(Exception e, EELFLoggerDelegate logger) {
+ logger.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e);
+
+ ExceptionResponse exceptionResponse = new ExceptionResponse(e);
+ return exceptionResponse;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java b/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
index abef8d62b..2368649a4 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/HealthCheckController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/HealthCheckController.java
@@ -1,196 +1,192 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.io.IOException;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.springframework.http.MediaType;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.dao.FnAppDoaImpl;
-
-/**
- * Controller for user profile view. The view is restricted to authenticated
- * users. The view name resolves to page user_profile.jsp which uses Angular.
- */
-
-@RestController
-@RequestMapping("/")
-public class HealthCheckController extends UnRestrictedBaseController {
-
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(HealthCheckController.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- private static final String HEALTH_CHECK_PATH = "/healthCheck";
-
- /**
- * Model for JSON response with health-check results.
- */
- public class HealthStatus {
- // Either 200 or 500
- public int statusCode;
-
- // Additional detail in case of error, empty in case of success.
- public String message;
-
- public String date;
-
- public HealthStatus(int code, String msg) {
- this.statusCode = code;
- this.message = msg;
- }
-
- public HealthStatus(int code,String date, String msg) {
- this.statusCode = code;
- this.message = msg;
- this.date=date;
- }
-
- public int getStatusCode() {
- return statusCode;
- }
-
- public void setStatusCode(int code) {
- this.statusCode = code;
- }
-
- public String getMessage() {
- return message;
- }
-
- public void setMessage(String msg) {
- this.message = msg;
- }
-
- public String getDate() {
- return date;
- }
-
- public void setDate(String date) {
- this.date = date;
- }
-
- }
-
- @SuppressWarnings("unchecked")
- public int getProfileCount(String driver, String URL, String username, String password) {
- FnAppDoaImpl doa= new FnAppDoaImpl();
- int count= doa.getProfileCount(driver,URL,username,password);
- return count;
- }
-
-
-
- /**
- * Obtain the HealthCheck Status from the System.Properties file.
- * Used by IDNS for redundancy
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- */
- @RequestMapping(value="/healthCheck",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public HealthStatus gethealthCheckStatusforIDNS() throws IOException, InterruptedException {
-
- String driver = SystemProperties.getProperty("db.driver");
- String URL = SystemProperties.getProperty("db.connectionURL");
- String username = SystemProperties.getProperty("db.userName");
- String password = SystemProperties.getProperty("db.password");
-
- logger.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
- logger.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
- logger.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
- logger.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
-
-
- HealthStatus healthStatus = null;
- try {
- logger.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
- int count=getProfileCount(driver,URL,username,password);
- logger.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
- healthStatus = new HealthStatus(200, "health check succeeded");
- } catch (Exception ex) {
-
- logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
- healthStatus = new HealthStatus(500, "health check failed: " + ex.toString());
- }
- return healthStatus;
- }
-
- /**
- * Obtain the HealthCheck Status from the System.Properties file.
- *
- * @return ResponseEntity The response entity
- * @throws IOException Signals that an I/O exception has occurred.
- * @throws InterruptedException the interrupted exception
- * Project :
- */
- @RequestMapping(value="rest/healthCheck/{User-Agent}/{X-ECOMP-RequestID}",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
- public HealthStatus getHealthCheck(
- @PathVariable("User-Agent") String UserAgent,
- @PathVariable("X-ECOMP-RequestID") String ECOMPRequestID) throws IOException, InterruptedException {
-
- String driver = SystemProperties.getProperty("db.driver");
- String URL = SystemProperties.getProperty("db.connectionURL");
- String username = SystemProperties.getProperty("db.userName");
- String password = SystemProperties.getProperty("db.password");
-
- logger.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
- logger.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
- logger.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
- logger.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
-
-
- HealthStatus healthStatus = null;
- try {
- logger.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
- logger.debug(EELFLoggerDelegate.debugLogger, "User-Agent" + UserAgent);
- logger.debug(EELFLoggerDelegate.debugLogger, "X-ECOMP-RequestID" + ECOMPRequestID);
-
-
- int count=getProfileCount(driver,URL,username,password);
-
- logger.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
- healthStatus = new HealthStatus(200,dateFormat.format(new Date()) ,"health check succeeded");
- } catch (Exception ex) {
-
- logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
- healthStatus = new HealthStatus(500,dateFormat.format(new Date()),"health check failed: " + ex.toString());
- }
- return healthStatus;
- }
-}
-
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.dao.FnAppDoaImpl;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+/**
+ * Controller for user profile view. The view is restricted to authenticated
+ * users. The view name resolves to page user_profile.jsp which uses Angular.
+ */
+
+@RestController
+@RequestMapping("/")
+public class HealthCheckController extends UnRestrictedBaseController {
+
+
+ /** The logger. */
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(HealthCheckController.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ private static final String HEALTH_CHECK_PATH = "/healthCheck";
+
+ /**
+ * Model for JSON response with health-check results.
+ */
+ public class HealthStatus {
+ // Either 200 or 500
+ public int statusCode;
+
+ // Additional detail in case of error, empty in case of success.
+ public String message;
+
+ public String date;
+
+ public HealthStatus(int code, String msg) {
+ this.statusCode = code;
+ this.message = msg;
+ }
+
+ public HealthStatus(int code,String date, String msg) {
+ this.statusCode = code;
+ this.message = msg;
+ this.date=date;
+ }
+
+ public int getStatusCode() {
+ return statusCode;
+ }
+
+ public void setStatusCode(int code) {
+ this.statusCode = code;
+ }
+
+ public String getMessage() {
+ return message;
+ }
+
+ public void setMessage(String msg) {
+ this.message = msg;
+ }
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+
+ }
+
+ @SuppressWarnings("unchecked")
+ public int getProfileCount(String driver, String URL, String username, String password) {
+ FnAppDoaImpl doa= new FnAppDoaImpl();
+ int count= doa.getProfileCount(driver,URL,username,password);
+ return count;
+ }
+
+
+
+ /**
+ * Obtain the HealthCheck Status from the System.Properties file.
+ * Used by IDNS for redundancy
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ */
+ @RequestMapping(value="/healthCheck",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public HealthStatus gethealthCheckStatusforIDNS() throws IOException, InterruptedException {
+
+ String driver = SystemProperties.getProperty("db.driver");
+ String URL = SystemProperties.getProperty("db.connectionURL");
+ String username = SystemProperties.getProperty("db.userName");
+ String password = SystemProperties.getProperty("db.password");
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
+
+
+ HealthStatus healthStatus = null;
+ try {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
+ int count=getProfileCount(driver,URL,username,password);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
+ healthStatus = new HealthStatus(200, "health check succeeded");
+ } catch (Exception ex) {
+
+ LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
+ healthStatus = new HealthStatus(500, "health check failed: " + ex.toString());
+ }
+ return healthStatus;
+ }
+
+ /**
+ * Obtain the HealthCheck Status from the System.Properties file.
+ *
+ * @return ResponseEntity The response entity
+ * @throws IOException Signals that an I/O exception has occurred.
+ * @throws InterruptedException the interrupted exception
+ * Project :
+ */
+ @RequestMapping(value="rest/healthCheck/{User-Agent}/{X-ECOMP-RequestID}",method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
+ public HealthStatus getHealthCheck(
+ @PathVariable("User-Agent") String UserAgent,
+ @PathVariable("X-ECOMP-RequestID") String ECOMPRequestID) throws IOException, InterruptedException {
+
+ String driver = SystemProperties.getProperty("db.driver");
+ String URL = SystemProperties.getProperty("db.connectionURL");
+ String username = SystemProperties.getProperty("db.userName");
+ String password = SystemProperties.getProperty("db.password");
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "driver ::" + driver);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "URL::" + URL);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "username::" + username);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger,"password::" + password);
+
+
+ HealthStatus healthStatus = null;
+ try {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "Performing health check");
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "User-Agent" + UserAgent);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "X-ECOMP-RequestID" + ECOMPRequestID);
+
+
+ int count=getProfileCount(driver,URL,username,password);
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger,"count:::"+count);
+ healthStatus = new HealthStatus(200,dateFormat.format(new Date()) ,"health check succeeded");
+ } catch (Exception ex) {
+
+ LOGGER.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
+ healthStatus = new HealthStatus(500,dateFormat.format(new Date()),"health check failed: " + ex.toString());
+ }
+ return healthStatus;
+ }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java b/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
new file mode 100644
index 000000000..e70c87115
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/LoggerController.java
@@ -0,0 +1,115 @@
+package org.onap.vid.controller;
+
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.core.Appender;
+import ch.qos.logback.core.FileAppender;
+import ch.qos.logback.core.spi.AppenderAttachable;
+import org.apache.commons.io.input.ReversedLinesFileReader;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.utils.Streams;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.InternalServerErrorException;
+import javax.ws.rs.NotAuthorizedException;
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Objects;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static com.att.eelf.configuration.Configuration.GENERAL_LOGGER_NAME;
+
+
+@RestController
+@RequestMapping("logger")
+public class LoggerController extends RestrictedBaseController {
+
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(LoggerController.class);
+
+ @Autowired
+ RoleProvider roleProvider;
+
+ @RequestMapping(value = "/{loggerName:audit|error|metrics}", method = RequestMethod.GET)
+ public String getLog(@PathVariable String loggerName, HttpServletRequest request,
+ @RequestParam(value="limit", defaultValue = "5000") Integer limit) throws IOException {
+
+ List<Role> roles = roleProvider.getUserRoles(request);
+ boolean userPermitted = roleProvider.userPermissionIsReadLogs(roles);
+ if (!userPermitted) {
+ throw new NotAuthorizedException("User not authorized to get logs");
+ }
+
+ String logfilePath = getLogfilePath(loggerName);
+
+ try (final ReversedLinesFileReader reader = new ReversedLinesFileReader(new File(logfilePath))) {
+ Supplier<String> reverseLinesSupplier = () -> {
+ try {
+ return reader.readLine();
+ } catch (NullPointerException e) {
+ // EOF Reached
+ return null;
+ } catch (IOException e) {
+ throw new InternalServerErrorException("error while reading " + logfilePath, e);
+ }
+ };
+
+ return Streams.takeWhile(
+ Stream.generate(reverseLinesSupplier),
+ line -> !StringUtils.contains(line, "Logging is started"))
+ .limit(limit)
+ .limit(5_000)
+ .filter(Objects::nonNull)
+ .collect(Collectors.joining("\n"));
+ }
+ }
+
+ private String getLogfilePath(String loggerName) {
+ /*
+ Find the requested logger, and pull all of it's appenders.
+ Find the first of the appenders that is a FileAppender, and return it's
+ write-out filename.
+ */
+ LoggerContext context = (LoggerContext) LoggerFactory.getILoggerFactory();
+ return context.getLoggerList().stream()
+ .filter(logger -> logger.getName().equals(GENERAL_LOGGER_NAME + "." + loggerName))
+ .flatMap(this::pullSubAppenders)
+ .flatMap(appender -> {
+ // Appender might be "attachable", if so - roll-up its sub-appenders
+ return (appender instanceof AppenderAttachable) ?
+ pullSubAppenders((AppenderAttachable<?>) appender) : Stream.of(appender);
+ })
+ .filter(appender -> appender instanceof FileAppender)
+ .map(appender -> (FileAppender<?>) appender)
+ .map(FileAppender::getFile)
+ .findFirst()
+ .orElseThrow(() -> new InternalServerErrorException("logfile for " + loggerName + " not found"));
+ }
+
+ private <T> Stream<Appender<T>> pullSubAppenders(AppenderAttachable<T> logger) {
+ return Streams.fromIterator(logger.iteratorForAppenders());
+ }
+
+ @ExceptionHandler({ NotAuthorizedException.class })
+ @ResponseStatus(HttpStatus.UNAUTHORIZED)
+ public String notAuthorizedHandler(NotAuthorizedException e) {
+ return "UNAUTHORIZED";
+ }
+
+ @ExceptionHandler({ IOException.class, InternalServerErrorException.class })
+ @ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
+ public ExceptionResponse ioExceptionHandler(Exception e) {
+ return org.onap.vid.controller.ControllersUtils.handleException(e, LOGGER);
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java b/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java
new file mode 100644
index 000000000..df1e6e421
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MaintenanceController.java
@@ -0,0 +1,135 @@
+package org.onap.vid.controller;
+
+
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.model.CategoryParameter.Family;
+import org.onap.vid.model.CategoryParameterOption;
+import org.onap.vid.services.CategoryParameterService;
+import org.onap.vid.services.CategoryParameterServiceImpl;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.ForbiddenException;
+import java.util.Arrays;
+import java.util.Collections;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * Controler for APIs that are used only by vid operators
+ */
+
+@RestController
+@RequestMapping(MaintenanceController.Maintenance)
+public class MaintenanceController extends UnRestrictedBaseController {
+
+ public static final String Maintenance = "maintenance";
+
+ @Autowired
+ protected CategoryParameterService categoryParameterService;
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(MaintenanceController.class);
+
+ /**
+ * Add list of options to one category parameter
+ * @param request the request
+ * @return the new option
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/category_parameter/{categoryName}", method = RequestMethod.POST)
+ public ResponseEntity addCategoryOptions (
+ HttpServletRequest request, @PathVariable String categoryName, @RequestBody AddCategoryOptionsRequest option) throws Exception {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+ try {
+ AddCategoryOptionResponse response = categoryParameterService.createCategoryParameterOptions(categoryName, option);
+ HttpStatus httpStatus = response.getErrors().size()>0 ? HttpStatus.MULTI_STATUS : HttpStatus.OK;
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+ return new ResponseEntity<>(response, httpStatus);
+ }
+ catch (CategoryParameterServiceImpl.UnfoundedCategoryException exception) {
+ return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.NOT_FOUND);
+ }
+ catch (Exception exception) {
+ LOGGER.error("failed to add option to parameter category " + categoryName, exception);
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ @RequestMapping(value = "/category_parameter/{categoryName}", method = RequestMethod.PUT)
+ public ResponseEntity updateNameForOption (
+ HttpServletRequest request, @PathVariable String categoryName, @RequestBody CategoryParameterOptionRep option) throws Exception {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+ try {
+ AddCategoryOptionResponse response = categoryParameterService.updateCategoryParameterOption(categoryName, option);
+ HttpStatus httpStatus = response.getErrors().size()>0 ? HttpStatus.MULTI_STATUS : HttpStatus.OK;
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+ return new ResponseEntity<>(response, httpStatus);
+ }
+ catch (ForbiddenException exception) {
+ return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.FORBIDDEN);
+ }
+ catch (CategoryParameterServiceImpl.UnfoundedCategoryException|CategoryParameterServiceImpl.UnfoundedCategoryOptionException exception) {
+ return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.NOT_FOUND);
+ }
+ catch (CategoryParameterServiceImpl.AlreadyExistOptionNameException exception) {
+ return new ResponseEntity<>(new AddCategoryOptionResponse(Collections.singletonList(exception.getMessage())), HttpStatus.CONFLICT);
+ }
+ catch (Exception exception) {
+ LOGGER.error("failed to update option to parameter category " + categoryName, exception);
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+ /**
+ * Gets the owning entity properties.
+ * @param request the request
+ * @return the property
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/category_parameter", method = RequestMethod.GET)
+ public ResponseEntity getCategoryParameter(HttpServletRequest request, @RequestParam(value="familyName", required = true) Family familyName) throws Exception {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+ try {
+ CategoryParametersResponse response = categoryParameterService.getCategoryParameters(familyName);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+ return new ResponseEntity<>(response, HttpStatus.OK);
+ }
+ catch (Exception exception) {
+ LOGGER.error("failed to retrieve category parameter list from DB.", exception);
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+
+ /**
+ * Delete option of the category.
+ * @param request the request
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/delete_category_parameter/{categoryName}", method = RequestMethod.POST)
+ public ResponseEntity deleteCategoryOption (
+ HttpServletRequest request, @PathVariable String categoryName, @RequestBody CategoryParameterOption option) throws Exception {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+
+ try {
+ categoryParameterService.deleteCategoryOption(categoryName, option);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), HttpStatus.OK);
+ return new ResponseEntity<>(HttpStatus.OK);
+ }
+ catch (CategoryParameterServiceImpl.UnfoundedCategoryException exception) {
+ return new ResponseEntity<>(new AddCategoryOptionResponse(Arrays.asList(exception.getMessage())), HttpStatus.NOT_FOUND);
+ }
+ catch (Exception exception) {
+ LOGGER.error("failed to add/update owning entity option", exception);
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
index e0b59204a..2aa52b858 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoConfig.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MsoConfig.java
@@ -1,7 +1,11 @@
-package org.openecomp.vid.controller;
+package org.onap.vid.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
-import org.openecomp.vid.factories.MsoRequestFactory;
+import org.onap.vid.factories.MsoRequestFactory;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoBusinessLogicImpl;
+import org.onap.vid.mso.MsoInterface;
+import org.onap.vid.mso.rest.MsoRestClientNew;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -24,6 +28,15 @@ public class MsoConfig {
return new MsoRequestFactory();
}
+ @Bean
+ public MsoInterface getMsoClient(){
+ return new MsoRestClientNew();
+ }
+
+ @Bean
+ public MsoBusinessLogic getMsoBusinessLogic(){
+ return new MsoBusinessLogicImpl(getMsoClient());
+ }
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java b/vid-app-common/src/main/java/org/onap/vid/controller/MsoController.java
index 451b19de7..1ce1d64c4 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/MsoController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/MsoController.java
@@ -1,770 +1,655 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-//import java.util.UUID;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Scanner;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.JsonEncoding;
-import org.codehaus.jackson.JsonFactory;
-import org.codehaus.jackson.JsonGenerator;
-import org.codehaus.jackson.JsonParser;
-import org.codehaus.jackson.JsonToken;
-import org.glassfish.jersey.client.ClientResponse;
-import org.json.simple.JSONArray;
-import org.json.simple.JSONObject;
-import org.json.simple.parser.JSONParser;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.openecomp.vid.mso.*;
-import org.openecomp.vid.mso.rest.*;
-import org.springframework.http.HttpStatus;
-//import org.springframework.http.ResponseEntity;
-//import org.springframework.http.RequestEntity;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import com.fasterxml.jackson.databind.ObjectReader;
-import com.fasterxml.jackson.databind.DeserializationFeature;
-
-/**
- * The Class MsoController.
- */
-@RestController
-@RequestMapping("mso")
-public class MsoController extends RestrictedBaseController {
-
- /**
- * The view name.
- */
- String viewName;
-
- /**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoController.class);
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * The Constant SVC_INSTANCE_ID.
- */
- public final static String SVC_INSTANCE_ID = "<service_instance_id>";
- public final static String REQUEST_TYPE = "<request_type>";
-
- /**
- * The Constant VNF_INSTANCE_ID.
- */
- public final static String VNF_INSTANCE_ID = "<vnf_instance_id>";
-
- /**
- * Welcome.
- *
- * @param request the request
- * @return the model and view
-
- public ModelAndView welcome(HttpServletRequest request) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== MsoController welcome start");
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + " MSO_SERVER_URL=" +
- SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) );
- return new ModelAndView(getViewName());
- }
- */
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
-
- public String getViewName() {
- return viewName;
- }
- */
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
-
- public void setViewName(String viewName) {
- this.viewName = viewName;
- }
- */
-
- /**
- * Creates the svc instance.
- *
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
- public ResponseEntity<String> createSvcInstance(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "createSvcInstance";
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
- // always return OK, the MSO status code is embedded in the body
-
- MsoResponseWrapper w = mbl.createSvcInstance(mso_request);
-
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
-
- /**
- * Creates the svc instance.
- *
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
-
- public ResponseEntity<String> createSvcInstanceNewRest(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "createSvcInstance";
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogicNew mbln = new MsoBusinessLogicNew();
-
- // always return OK, the MSO status code is embedded in the body
-
- MsoResponseWrapper w = mbln.createSvcInstanceRest(mso_request);
-
- if (w == null) {
- return null;
- }
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Creates the svc instance.
- *
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
-
- public ResponseEntity<String> createSvcInstanceNew(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "createSvcInstance";
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogicNew mbln = new MsoBusinessLogicNew();
- // always return OK, the MSO status code is embedded in the body
-
- MsoResponseWrapper w = mbln.createSvcInstance(mso_request);
-
- if (w == null) {
- return null;
- }
-
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Creates the vnf.
- *
- * @param serviceInstanceId the service instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.createVnf(mso_request, serviceInstanceId);
-
- // always return OK, the MSO status code is embedded in the body
-
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Creates the nw instance.
- *
- * @param serviceInstanceId the service instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "createNwInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start, serviceInstanceId = " + serviceInstanceId);
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.createNwInstance(mso_request, serviceInstanceId);
-
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Creates the volume group instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
- HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "createVolumeGroupInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.createVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
- }
-
- /**
- * Creates the vf module instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "createVfModuleInstance";
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.createVfModuleInstance(mso_request, serviceInstanceId, vnfInstanceId);
-
- // always return OK, the MSO status code is embedded in the body
-
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
- }
-
- /**
- * Creates the instance.
- *
- * @param request the request
- * @param path the path
- * @return the mso response wrapper
- * @throws ClientHandlerException the client handler exception
- * @throws Exception the exception
- */
- protected MsoResponseWrapper createInstance(RequestDetails request, String path) throws Exception {
- String methodName = "createInstance";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
- MsoRestInterfaceIfc restController = new MsoRestInterface();
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Post, request = (" + request + ")");
-
- RestObject<String> restObjStr = new RestObject<String>();
- String str = new String();
- restObjStr.set(str);
- restController.<String>Post(str, request, "", path, restObjStr);
- MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
- return w;
- } catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- /**
- * Delete svc instance.
- *
- * @param serviceInstanceId the service instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
- String methodName = "deleteSvcInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.deleteSvcInstance(mso_request, serviceInstanceId);
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
- // always return OK, the MSO status code is embedded in the body
-
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Delete vnf.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
-
- public ResponseEntity<String> deleteVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
- HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "deleteVnf";
-
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mlb = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mlb.deleteVnf(mso_request, serviceInstanceId, vnfInstanceId);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Delete vf module.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param vfModuleId the vf module id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- //mso_delete_vf_module/bc305d54-75b4-431b-adb2-eb6b9e546014/vnfs/fe9000-0009-9999/vfmodules/abeeee-abeeee-abeeee
- @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteVfModule(
- @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
- @PathVariable("vfModuleId") String vfModuleId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
- String methodName = "deleteVfModule";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId, vfModuleId);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Delete volume group instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param volumeGroupId the volume group id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteVolumeGroupInstance(
- @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId, @PathVariable("volumeGroupId") String volumeGroupId,
- HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "deleteVolumeGroupInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.deleteVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId, volumeGroupId);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
- }
-
- /**
- * Delete nw instance.
- *
- * @param serviceInstanceId the service instance id
- * @param networkInstanceId the network instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
- String methodName = "deleteNwInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.deleteNwInstance(mso_request, serviceInstanceId, networkInstanceId);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
-
- }
-
- /**
- * Gets the orchestration request.
- *
- * @param requestId the request id
- * @param request the request
- * @return the orchestration request
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
- public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
- HttpServletRequest request) throws Exception {
-
- String methodName = "getOrchestrationRequest";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.getOrchestrationRequest(requestId);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
- }
-
-
- /**
- * Gets the orchestration requests.
- *
- * @param filterString the filter string
- * @param request the request
- * @return the orchestration requests
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
- public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
- HttpServletRequest request) throws Exception {
-
- String methodName = "getOrchestrationRequests";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.getOrchestrationRequests(filterString);
-
- // always return OK, the MSO status code is embedded in the body
- return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
- }
-
-
- /**
- * activate to a pnf instance.
- *
- * @param serviceInstanceId the id of the service.
- * @param requestDetails the body of the request.
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_activate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> activateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
- String methodName = "activateServiceInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.activateServiceInstance(requestDetails, serviceInstanceId);
- return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
- }
-
-
- /**
- * Gets the orchestration requests for the dashboard.
- * currently its all the orchestration requests with RequestType updateInstance or replaceInstance.
- * @return the orchestration requests
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_get_orch_reqs/dashboard", method = RequestMethod.GET)
- public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
-
- String methodName = "getOrchestrationRequestsForDashboard";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- return mbl.getOrchestrationRequestsForDashboard();
- }
-
- /**
- * Gets the Manual Tasks for the given request id.
- *
- * @param originalRequestId the id of the original request.
- * @return the tasks
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_get_man_task/{originalRequestId}", method = RequestMethod.GET)
- public List<Task> getManualTasksByRequestId(@PathVariable("originalRequestId") String originalRequestId) throws Exception {
-
- String methodName = "getManualTasksByRequestId";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- return mbl.getManualTasksByRequestId(originalRequestId);
- }
-
-
-
- /**
- * Complete the manual task.
- *
- * @param taskId the id of the task to complete.
- * @param requestDetails the body of the request.
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_post_man_task/{taskId}", method = RequestMethod.POST)
- public ResponseEntity<String> manualTaskComplete(@PathVariable("taskId") String taskId , @RequestBody RequestDetails requestDetails) throws Exception {
-
- String methodName = "manualTaskComplete";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- MsoBusinessLogic mbl = new MsoBusinessLogic();
-
- MsoResponseWrapper w = mbl.completeManualTask(requestDetails, taskId);
- return new ResponseEntity<String>(w.getResponse(), HttpStatus.OK);
- }
-
-
-
-
-
- /**
- * Gets the orchestration requests for svc instance.
- *
- * @param svc_instance_id the svc instance id
- * @return the orchestration requests for svc instance
- * @throws Exception the exception
- */
-// public MsoResponseWrapper getOrchestrationRequestsForSvcInstance(String svc_instance_id) throws Exception {
-
-// String methodName = "getOrchestrationRequestsForSvcInstance";
-// logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-// MsoResponseWrapper w = null;
-//
-// try {
-// MsoRestInterfaceIfc restController = MsoRestInterfaceFactory.getInstance();
-// String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
-// String path = p + svc_instance_id;
-//
-// RestObject<String> restObjStr = new RestObject<String>();
-// String str = new String();
-// restObjStr.set(str);
-//
-// restController.<String>Get(str, "", path, restObjStr);
-// w = MsoUtil.wrapResponse(restObjStr);
-// logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
-//
-// } catch (Exception e) {
-// logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-// logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
-// throw e;
-// }
-// return w;
-// }
-
- /**
- * Exception handler.
- *
- * @param e the e
- * @param response the response
- * @throws IOException Signals that an I/O exception has occurred.
- */
- @ExceptionHandler(Exception.class)
- private void exceptionHandler(Exception e, HttpServletResponse response) throws IOException {
-
- /*
- * The following "logger.error" lines "should" be sufficient for logging the exception.
- * However, the console output in my Eclipse environment is NOT showing ANY of the
- * logger statements in this class. Thus the temporary "e.printStackTrace" statement
- * is also included.
- */
-
- String methodName = "exceptionHandler";
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- StringWriter sw = new StringWriter();
- e.printStackTrace(new PrintWriter(sw));
- logger.error(EELFLoggerDelegate.errorLogger, sw.toString());
-
- /*
- * Temporary - IF the above mentioned "logger.error" glitch is resolved ...
- * this statement could be removed since it would then likely result in duplicate
- * trace output.
- */
- e.printStackTrace(System.err);
-
- response.setContentType("application/json; charset=UTF-8");
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
- ExceptionResponse exceptionResponse = new ExceptionResponse();
- exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
- exceptionResponse.setMessage(e.getMessage());
-
- response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
- response.flushBuffer();
-
- }
-
- /**
- * Parses the orchestration requests for svc instance.
- *
- * @param resp the resp
- * @return the list
- * @throws ParseException the parse exception
- * @throws Exception the exception
- */
- @SuppressWarnings("unchecked")
- public List<JSONObject> parseOrchestrationRequestsForSvcInstance(ClientResponse resp) throws org.json.simple.parser.ParseException, Exception {
-
- String methodName = "parseOrchestrationRequestsForSvcInstance";
-
- ArrayList<JSONObject> json_list = new ArrayList<JSONObject>();
-
- String rlist_str = resp.readEntity(String.class);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + " Response string: " + rlist_str);
-
- JSONParser parser = new JSONParser();
- try {
- Object obj = parser.parse(rlist_str);
-
- JSONObject jsonObject = (JSONObject) obj;
-
- JSONArray requestList = (JSONArray) jsonObject.get("requestList");
-
- if (requestList != null && !(requestList.isEmpty()))
- for (Object container : requestList) {
-
- JSONObject containerJsonObj = (JSONObject) container;
- //logger.debug(dateFormat.format(new Date()) + "<== " + "." + methodName + " reqJsonObj: " + containerJsonObj.toJSONString());
- JSONObject reqJsonObj = (JSONObject) containerJsonObj.get("request");
-
- //logger.debug(dateFormat.format(new Date()) + "<== " + "." + methodName + " reqJsonObj.requestId: " +
- // reqJsonObj.get("requestId") );
- JSONObject result = new JSONObject();
-
- result.put("requestId", reqJsonObj.get("requestId"));
- if (reqJsonObj.get("requestType") != null) {
- result.put("requestType", (reqJsonObj.get("requestType").toString()));
- }
- JSONObject req_status = (JSONObject) reqJsonObj.get("requestStatus");
- if (req_status != null) {
- result.put("timestamp", (req_status.get("timestamp")));
- result.put("requestState", (req_status.get("requestState")));
- result.put("statusMessage", (req_status.get("statusMessage")));
- result.put("percentProgress", (req_status.get("percentProgress")));
- }
- json_list.add(result);
- }
- } catch (org.json.simple.parser.ParseException pe) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + " Parse exception: " + pe.toString());
- throw pe;
- } catch (Exception e) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + " Exception: " + e.toString());
- throw e;
- }
- return (json_list);
- }
-
- /**
- * Retrieve request object.
- *
- * @param request the request
- * @return the request details
- * @throws Exception the exception
- */
- public RequestDetails retrieveRequestObject(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
-
- String methodName = "retrieveRequestObject";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- ObjectMapper mapper = new ObjectMapper();
- //JSON from String to Object
- //RequestDetails mso_request;
-
- try {
- //mso_request = new RequestDetails();
- //mso_request = mapper.readValue(request.getInputStream(), RequestDetails.class);
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " Unable to read json object RequestDetails e=" + e.getMessage());
- throw e;
- }
- if (mso_request == null) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " mso_request is null");
- throw new Exception("RequestDetails is missing");
- }
- try {
- String json_req = mapper.writeValueAsString(mso_request);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " request=[" + json_req + "]");
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " Unable to convert RequestDetails to json string e=" + e.getMessage());
- throw e;
- }
- return (mso_request);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoResponseWrapper;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.Task;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.List;
+
+//import java.util.UUID;
+//import org.springframework.http.ResponseEntity;
+//import org.springframework.http.RequestEntity;
+
+/**
+ * The Class MsoController.
+ */
+@RestController
+@RequestMapping("mso")
+public class MsoController extends RestrictedBaseController {
+
+ /**
+ * The logger.
+ */
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(MsoController.class);
+
+ /**
+ * The Constant dateFormat.
+ */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /**
+ * The Constant SVC_INSTANCE_ID.
+ */
+ public final static String SVC_INSTANCE_ID = "<service_instance_id>";
+ public final static String REQUEST_TYPE = "<request_type>";
+
+ /**
+ * The Constant CONFIGURATION_ID
+ */
+ public final static String CONFIGURATION_ID = "<configuration_id>";
+
+ /**
+ * The Constant VNF_INSTANCE_ID.
+ */
+ public final static String VNF_INSTANCE_ID = "<vnf_instance_id>";
+
+ private final MsoBusinessLogic msoBusinessLogic;
+
+ @Autowired
+ public MsoController(MsoBusinessLogic msoBusinessLogic) {
+ this.msoBusinessLogic = msoBusinessLogic;
+ }
+
+ /**
+ * Creates the svc instance.
+ *
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
+ public ResponseEntity<String> createSvcInstance(HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "createSvcInstance";
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ // always return OK, the MSO status code is embedded in the body
+
+ MsoResponseWrapper w = msoBusinessLogic.createSvcInstance(mso_request);
+
+ return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Creates the vnf.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+
+ MsoResponseWrapper w = msoBusinessLogic.createVnf(mso_request, serviceInstanceId);
+
+ // always return OK, the MSO status code is embedded in the body
+
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Creates the nw instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "createNwInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start, serviceInstanceId = " + serviceInstanceId);
+
+ MsoResponseWrapper w = msoBusinessLogic.createNwInstance(mso_request, serviceInstanceId);
+
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Creates the volume group instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
+ HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "createVolumeGroupInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.createVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Creates the vf module instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "createVfModuleInstance";
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.createVfModuleInstance(mso_request, serviceInstanceId, vnfInstanceId);
+
+ // always return OK, the MSO status code is embedded in the body
+
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Creates a configuration instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_configuration_instance/{serviceInstanceId}/configurations/", method = RequestMethod.POST)
+ public ResponseEntity<String> createConfigurationInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "createConfigurationInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.createConfigurationInstance(mso_request, serviceInstanceId);
+
+ // always return OK, the MSO status code is embedded in the body
+
+ return (new ResponseEntity<>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Delete svc instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+
+ String methodName = "deleteSvcInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteSvcInstance(mso_request, serviceInstanceId);
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
+ // always return OK, the MSO status code is embedded in the body
+
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Delete vnf.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+
+ public ResponseEntity<String> deleteVnf(@PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
+ HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "deleteVnf";
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteVnf(mso_request, serviceInstanceId, vnfInstanceId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Delete configuration instance
+ * @param serviceInstanceId the service instance id
+ * @param configurationId the configuration id
+ * @param mso_request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "mso_delete_configuration/{serviceInstanceId}/configurations/{configurationId}",
+ method = RequestMethod.POST)
+ public ResponseEntity<String> deleteConfiguration(
+ @PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable ("configurationId") String configurationId,
+ @RequestBody RequestDetails mso_request) throws Exception {
+
+ String methodName = "deleteConfiguration";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger,
+ dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteConfiguration(mso_request, serviceInstanceId, configurationId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Activate configuration instance
+ * @param serviceInstanceId the service instace id
+ * @param configurationId the configuration id
+ * @param mso_request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "mso_activate_configuration/{serviceInstanceId}/configurations/{configurationId}",
+ method = RequestMethod.POST)
+ public ResponseEntity<String> activateConfiguration(
+ @PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("configurationId") String configurationId,
+ @RequestBody RequestDetails mso_request) throws Exception {
+
+ MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(mso_request, serviceInstanceId, configurationId, true);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Deactivate configuration instance
+ * @param serviceInstanceId the service instace id
+ * @param configurationId the configuration id
+ * @param mso_request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "mso_deactivate_configuration/{serviceInstanceId}/configurations/{configurationId}",
+ method = RequestMethod.POST)
+ public ResponseEntity<String> deactivateConfiguration(
+ @PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("configurationId") String configurationId,
+ @RequestBody RequestDetails mso_request) throws Exception {
+
+ MsoResponseWrapper w = msoBusinessLogic.setConfigurationActiveStatus(mso_request, serviceInstanceId, configurationId, false);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Disable port on configuration instance
+ * @param serviceInstanceId the service instance id
+ * @param configurationId the configuration instance id
+ * @param mso_request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "mso_disable_port_configuration/{serviceInstanceId}/configurations/{configurationId}",
+ method = RequestMethod.POST)
+ public ResponseEntity<String> disablePortOnConfiguration(
+ @PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("configurationId") String configurationId,
+ @RequestBody RequestDetails mso_request) throws Exception {
+
+ MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(mso_request, serviceInstanceId, configurationId, false);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Enable port on configuration instance
+ * @param serviceInstanceId the service instance id
+ * @param configurationId the configuration instance id
+ * @param mso_request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "mso_enable_port_configuration/{serviceInstanceId}/configurations/{configurationId}",
+ method = RequestMethod.POST)
+ public ResponseEntity<String> enablePortOnConfiguration(
+ @PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("configurationId") String configurationId,
+ @RequestBody RequestDetails mso_request) throws Exception {
+
+ MsoResponseWrapper w = msoBusinessLogic.setPortOnConfigurationStatus(mso_request, serviceInstanceId, configurationId, true);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Delete vf module.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param vfModuleId the vf module id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ //mso_delete_vf_module/bc305d54-75b4-431b-adb2-eb6b9e546014/vnfs/fe9000-0009-9999/vfmodules/abeeee-abeeee-abeeee
+ @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteVfModule(
+ @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId,
+ @PathVariable("vfModuleId") String vfModuleId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+
+ String methodName = "deleteVfModule";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteVfModule(mso_request, serviceInstanceId, vnfInstanceId, vfModuleId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Delete volume group instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param volumeGroupId the volume group id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteVolumeGroupInstance(
+ @PathVariable("serviceInstanceId") String serviceInstanceId, @PathVariable("vnfInstanceId") String vnfInstanceId, @PathVariable("volumeGroupId") String volumeGroupId,
+ HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "deleteVolumeGroupInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteVolumeGroupInstance(mso_request, serviceInstanceId, vnfInstanceId, volumeGroupId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+ /**
+ * Delete nw instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param networkInstanceId the network instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request, @RequestBody RequestDetails mso_request) throws Exception {
+ String methodName = "deleteNwInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.deleteNwInstance(mso_request, serviceInstanceId, networkInstanceId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+
+ }
+
+ /**
+ * Gets the orchestration request.
+ *
+ * @param requestId the request id
+ * @param request the request
+ * @return the orchestration request
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
+ public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
+ HttpServletRequest request) throws Exception {
+
+ String methodName = "getOrchestrationRequest";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+
+ MsoResponseWrapper w = msoBusinessLogic.getOrchestrationRequest(requestId);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+
+ /**
+ * Gets the orchestration requests.
+ *
+ * @param filterString the filter string
+ * @param request the request
+ * @return the orchestration requests
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
+ public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
+ HttpServletRequest request) throws Exception {
+
+ String methodName = "getOrchestrationRequests";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+
+ MsoResponseWrapper w = msoBusinessLogic.getOrchestrationRequests(filterString);
+
+ // always return OK, the MSO status code is embedded in the body
+ return (new ResponseEntity<String>(w.getResponse(), HttpStatus.OK));
+ }
+
+
+ /**
+ * activate to a pnf instance.
+ *
+ * @param serviceInstanceId the id of the service.
+ * @param requestDetails the body of the request.
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_activate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> activateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
+ String methodName = "activateServiceInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.setServiceInstanceStatus(requestDetails, serviceInstanceId, true);
+ return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+ }
+
+ /**
+ * deactivate a service instance.
+ *
+ * @param serviceInstanceId the id of the service.
+ * @param requestDetails the body of the request.
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_deactivate_service_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deactivateServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId, @RequestBody RequestDetails requestDetails) throws Exception {
+ String methodName = "deactivateServiceInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.setServiceInstanceStatus(requestDetails, serviceInstanceId, false);
+ return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+ }
+
+
+ /**
+ * Gets the orchestration requests for the dashboard.
+ * currently its all the orchestration requests with RequestType updateInstance or replaceInstance.
+ * @return the orchestration requests
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_get_orch_reqs/dashboard", method = RequestMethod.GET)
+ public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
+
+ String methodName = "getOrchestrationRequestsForDashboard";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+
+ return msoBusinessLogic.getOrchestrationRequestsForDashboard();
+ }
+
+ /**
+ * Gets the Manual Tasks for the given request id.
+ *
+ * @param originalRequestId the id of the original request.
+ * @return the tasks
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_get_man_task/{originalRequestId}", method = RequestMethod.GET)
+ public List<Task> getManualTasksByRequestId(@PathVariable("originalRequestId") String originalRequestId) throws Exception {
+
+ String methodName = "getManualTasksByRequestId";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ return msoBusinessLogic.getManualTasksByRequestId(originalRequestId);
+ }
+
+
+
+ /**
+ * Complete the manual task.
+ *
+ * @param taskId the id of the task to complete.
+ * @param requestDetails the body of the request.
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_post_man_task/{taskId}", method = RequestMethod.POST)
+ public ResponseEntity<String> manualTaskComplete(@PathVariable("taskId") String taskId , @RequestBody RequestDetails requestDetails) throws Exception {
+
+ String methodName = "manualTaskComplete";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w = msoBusinessLogic.completeManualTask(requestDetails, taskId);
+ return new ResponseEntity<String>(w.getResponse(), HttpStatus.OK);
+ }
+
+ @RequestMapping(value = "/mso_remove_relationship/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> removeRelationshipFromServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId ,
+ @RequestBody RequestDetails requestDetails) throws Exception {
+
+ String methodName = "removeRelationshipFromServiceInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w;
+ try {
+ w = msoBusinessLogic.removeRelationshipFromServiceInstance(requestDetails, serviceInstanceId);
+ } catch (Exception e){
+ LOGGER.error("Internal error when calling MSO controller logic for {}", methodName, e);
+ return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+ }
+
+ @RequestMapping(value = "/mso_add_relationship/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> addRelationshipToServiceInstance(@PathVariable("serviceInstanceId") String serviceInstanceId ,
+ @RequestBody RequestDetails requestDetails) throws Exception {
+
+ String methodName = "addRelationshipToServiceInstance";
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ MsoResponseWrapper w;
+ try {
+ w = msoBusinessLogic.addRelationshipToServiceInstance(requestDetails, serviceInstanceId);
+ } catch (Exception e){
+ LOGGER.error("Internal error when calling MSO controller logic for {}", methodName, e);
+ return new ResponseEntity<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ return new ResponseEntity<>(w.getResponse(), HttpStatus.OK);
+ }
+
+
+ /**
+ * Exception handler.
+ *
+ * @param e the e
+ * @param response the response
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @ExceptionHandler(Exception.class)
+ private void exceptionHandler(Exception e, HttpServletResponse response) throws IOException {
+
+ /*
+ * The following "logger.error" lines "should" be sufficient for logging the exception.
+ * However, the console output in my Eclipse environment is NOT showing ANY of the
+ * logger statements in this class. Thus the temporary "e.printStackTrace" statement
+ * is also included.
+ */
+
+ String methodName = "exceptionHandler";
+ LOGGER.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ StringWriter sw = new StringWriter();
+ e.printStackTrace(new PrintWriter(sw));
+ LOGGER.error(EELFLoggerDelegate.errorLogger, sw.toString());
+
+ /*
+ * Temporary - IF the above mentioned "logger.error" glitch is resolved ...
+ * this statement could be removed since it would then likely result in duplicate
+ * trace output.
+ */
+ e.printStackTrace(System.err);
+
+ response.setContentType("application/json; charset=UTF-8");
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+ ExceptionResponse exceptionResponse = new ExceptionResponse();
+ exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+ exceptionResponse.setMessage(e.getMessage());
+
+ response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+ response.flushBuffer();
+
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java b/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
new file mode 100644
index 000000000..e57aab392
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/OperationalEnvironmentController.java
@@ -0,0 +1,354 @@
+package org.onap.vid.controller;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.MoreObjects;
+import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.model.ExceptionResponse;
+import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoResponseWrapper2;
+import org.onap.vid.mso.RestMsoImplementation;
+import org.onap.vid.mso.RestObject;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.MsoRestClientNew;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.MissingServletRequestParameterException;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+import static org.onap.vid.utils.Logging.getMethodCallerName;
+import static org.onap.vid.utils.Logging.getMethodName;
+import static org.springframework.http.HttpStatus.INTERNAL_SERVER_ERROR;
+
+@RestController
+@RequestMapping("operationalEnvironment")
+public class OperationalEnvironmentController extends RestrictedBaseController {
+
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(OperationalEnvironmentController.class);
+ private final RestMsoImplementation restMso;
+ private final MsoBusinessLogic msoBusinessLogic;
+
+ private static final Pattern RECOVERY_ACTION_MESSAGE_PATTERN = Pattern.compile("String value \'(.*)\': value not");
+
+
+ @Autowired
+ public OperationalEnvironmentController(MsoBusinessLogic msoBusinessLogic, MsoRestClientNew msoClientInterface) {
+ this.restMso = msoClientInterface;
+ this.msoBusinessLogic = msoBusinessLogic;
+ }
+
+ @RequestMapping(value = "/create", method = RequestMethod.POST)
+ public MsoResponseWrapper2 createOperationalEnvironment(HttpServletRequest request, @RequestBody OperationalEnvironmentCreateBody operationalEnvironment) throws Exception {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), operationalEnvironment);
+ String userId = ControllersUtils.extractUserId(request);
+ RequestDetailsWrapper<OperationEnvironmentRequestDetails> requestDetailsWrapper = msoBusinessLogic.convertParametersToRequestDetails(operationalEnvironment, userId);
+ String path = msoBusinessLogic.getOperationalEnvironmentCreationPath();
+ RestObject<RequestReferencesContainer> msoResponse = restMso.PostForObject(requestDetailsWrapper, "",
+ path, RequestReferencesContainer.class);
+ debugEnd(msoResponse);
+ return new MsoResponseWrapper2<>(msoResponse);
+ }
+
+ @RequestMapping(value = "/activate", method = RequestMethod.POST)
+ public MsoResponseWrapper2 activate(HttpServletRequest request,
+ @RequestParam("operationalEnvironment") String operationalEnvironmentId,
+ @RequestBody OperationalEnvironmentActivateBody activateRequest) throws Exception {
+
+ verifyIsNotEmpty(operationalEnvironmentId, "operationalEnvironment");
+
+ //manifest is null in case of wrong manifest structure (deserialization failure of the manifest)
+ if (activateRequest.getManifest()==null || activateRequest.getManifest().getServiceModelList()==null) {
+ throw new BadManifestException("Manifest structure is wrong");
+ }
+
+ String userId = ControllersUtils.extractUserId(request);
+
+ OperationalEnvironmentActivateInfo activateInfo = new OperationalEnvironmentActivateInfo(activateRequest, userId, operationalEnvironmentId);
+ debugStart(activateInfo);
+
+ String path = msoBusinessLogic.getOperationalEnvironmentActivationPath(activateInfo);
+ RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = msoBusinessLogic.createOperationalEnvironmentActivationRequestDetails(activateInfo);
+
+ RestObject<RequestReferencesContainer> msoResponse = restMso.PostForObject(requestDetailsWrapper, "",
+ path, RequestReferencesContainer.class);
+
+ debugEnd(msoResponse);
+ return new MsoResponseWrapper2<>(msoResponse);
+ }
+
+ @RequestMapping(value = "/deactivate", method = RequestMethod.POST)
+ public MsoResponseWrapper2 deactivate(HttpServletRequest request,
+ @RequestParam("operationalEnvironment") String operationalEnvironmentId,
+ @RequestBody Map deactivationRequest) throws Exception {
+
+ verifyIsNotEmpty(operationalEnvironmentId, "operationalEnvironment");
+
+ String userId = ControllersUtils.extractUserId(request);
+
+ OperationalEnvironmentDeactivateInfo deactivateInfo = new OperationalEnvironmentDeactivateInfo(userId, operationalEnvironmentId);
+ debugStart(deactivateInfo);
+
+ String path = msoBusinessLogic.getOperationalEnvironmentDeactivationPath(deactivateInfo);
+ RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = msoBusinessLogic.createOperationalEnvironmentDeactivationRequestDetails(deactivateInfo);
+
+ RestObject<RequestReferencesContainer> msoResponse = restMso.PostForObject(requestDetailsWrapper, "",
+ path, RequestReferencesContainer.class);
+
+ debugEnd(msoResponse);
+ return new MsoResponseWrapper2<>(msoResponse);
+ }
+
+ @RequestMapping(value = "/requestStatus", method = RequestMethod.GET)
+ public MsoResponseWrapper2 status(HttpServletRequest request, @RequestParam("requestId") String requestId) throws Exception {
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName(), requestId);
+
+ verifyIsNotEmpty(requestId, "requestId");
+ String path = msoBusinessLogic.getCloudResourcesRequestsStatusPath(requestId);
+
+ final RestObject<HashMap> msoResponse = restMso.GetForObject("", path, HashMap.class);
+
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), msoResponse);
+ return new MsoResponseWrapper2<>(msoResponse);
+ }
+
+ @ExceptionHandler(Exception.class)
+ @ResponseStatus(value=INTERNAL_SERVER_ERROR)
+ private ExceptionResponse exceptionHandler(Exception e) {
+ return ControllersUtils.handleException(e, LOGGER);
+ }
+
+ @ExceptionHandler({
+ org.springframework.web.bind.MissingServletRequestParameterException.class,
+ BadManifestException.class
+ })
+ @ResponseStatus(value = HttpStatus.BAD_REQUEST)
+ public ExceptionResponse clientDerivedExceptionAsBadRequest(Exception e) {
+ // same handler, different HTTP Code
+ return exceptionHandler(e);
+ }
+
+ @ExceptionHandler({
+ org.springframework.http.converter.HttpMessageNotReadableException.class,
+ })
+ @ResponseStatus(value = HttpStatus.BAD_REQUEST)
+ public ExceptionResponse handlingHttpMessageNotReadableException(Exception e) {
+ //in case of wrong value in manifest for RecoveryAction the message contains the class name.
+ //The wrong value is in also part of this messages
+ //within the pattern of: String value '<WRONG_VALUE>': value not
+ //so we use regex to find the wrong value
+ if (e.getMessage().contains(OperationalEnvironmentRecoveryAction.class.getName())) {
+ LOGGER.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodName(), ExceptionUtils.getMessage(e), e);
+ String message = "Wrong value for RecoveryAction in manifest. Allowed options are: "+OperationalEnvironmentRecoveryAction.options;
+
+ Matcher matcher = RECOVERY_ACTION_MESSAGE_PATTERN.matcher(e.getMessage());
+ if (matcher.find()) {
+ String wrongValue = matcher.group(1);
+ message = message+". Wrong value is: "+wrongValue;
+ }
+ return new ExceptionResponse(new BadManifestException(message));
+ }
+ return exceptionHandler(e);
+ }
+
+
+ public enum OperationalEnvironmentRecoveryAction {
+ abort,
+ retry,
+ skip;
+
+ public static final String options = Stream.of(OperationalEnvironmentRecoveryAction.values()).map(OperationalEnvironmentRecoveryAction::name).collect(Collectors.joining(", "));
+ }
+
+ public static class ActivateServiceModel {
+ private String serviceModelVersionId;
+ private OperationalEnvironmentRecoveryAction recoveryAction;
+
+ public ActivateServiceModel() {
+ }
+
+ public ActivateServiceModel(String serviceModelVersionId, OperationalEnvironmentRecoveryAction recoveryAction) {
+ this.serviceModelVersionId = serviceModelVersionId;
+ this.recoveryAction = recoveryAction;
+ }
+
+ public String getServiceModelVersionId() {
+ return serviceModelVersionId;
+ }
+
+ public void setServiceModelVersionId(String serviceModelVersionId) {
+ this.serviceModelVersionId = serviceModelVersionId;
+ }
+
+ public OperationalEnvironmentRecoveryAction getRecoveryAction() {
+ return recoveryAction;
+ }
+
+ public void setRecoveryAction(OperationalEnvironmentRecoveryAction recoveryAction) {
+ this.recoveryAction = recoveryAction;
+ }
+ }
+
+ @JsonIgnoreProperties(ignoreUnknown = true)
+ public static class OperationalEnvironmentManifest {
+
+
+ private List<ActivateServiceModel> serviceModelList;
+
+ public OperationalEnvironmentManifest() {
+ }
+
+ public OperationalEnvironmentManifest(List<ActivateServiceModel> serviceModelList) {
+ this.serviceModelList = serviceModelList;
+ }
+
+ public List<ActivateServiceModel> getServiceModelList() {
+ return serviceModelList;
+ }
+
+ public void setServiceModelList(List<ActivateServiceModel> serviceModelList) {
+ this.serviceModelList = serviceModelList;
+ }
+ }
+
+ public static class OperationalEnvironmentActivateBody {
+ private final String relatedInstanceId;
+ private final String relatedInstanceName;
+ private final String workloadContext;
+ private final OperationalEnvironmentManifest manifest;
+
+ public OperationalEnvironmentActivateBody(@JsonProperty(value = "relatedInstanceId", required = true) String relatedInstanceId,
+ @JsonProperty(value = "relatedInstanceName", required = true) String relatedInstanceName,
+ @JsonProperty(value = "workloadContext", required = true) String workloadContext,
+ @JsonProperty(value = "manifest", required = true) OperationalEnvironmentManifest manifest) {
+ this.relatedInstanceId = relatedInstanceId;
+ this.relatedInstanceName = relatedInstanceName;
+ this.workloadContext = workloadContext;
+ this.manifest = manifest;
+ }
+
+
+ public String getRelatedInstanceId() {
+ return relatedInstanceId;
+ }
+
+ public String getRelatedInstanceName() {
+ return relatedInstanceName;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ public OperationalEnvironmentManifest getManifest() {
+ return manifest;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("relatedInstanceId", relatedInstanceId)
+ .add("relatedInstanceName", relatedInstanceName)
+ .add("workloadContext", workloadContext)
+ .add("manifest", manifest)
+ .toString();
+ }
+ }
+
+ public static class OperationalEnvironmentCreateBody {
+ private final String instanceName;
+ private final String ecompInstanceId;
+ private final String ecompInstanceName;
+ private final String operationalEnvironmentType;
+ private final String tenantContext;
+ private final String workloadContext;
+
+ public OperationalEnvironmentCreateBody(@JsonProperty(value = "instanceName", required = true) String instanceName,
+ @JsonProperty(value = "ecompInstanceId", required = true) String ecompInstanceId,
+ @JsonProperty(value = "ecompInstanceName", required = true) String ecompInstanceName,
+ @JsonProperty(value = "operationalEnvironmentType", required = true) String operationalEnvironmentType,
+ @JsonProperty(value = "tenantContext", required = true) String tenantContext,
+ @JsonProperty(value = "workloadContext", required = true) String workloadContext) {
+ this.instanceName = instanceName;
+ this.ecompInstanceId = ecompInstanceId;
+ this.ecompInstanceName = ecompInstanceName;
+ this.operationalEnvironmentType = operationalEnvironmentType;
+ this.tenantContext = tenantContext;
+ this.workloadContext = workloadContext;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public String getEcompInstanceId() {
+ return ecompInstanceId;
+ }
+
+ public String getEcompInstanceName() {
+ return ecompInstanceName;
+ }
+
+ public String getOperationalEnvironmentType() {
+ return operationalEnvironmentType;
+ }
+
+ public String getTenantContext() {
+ return tenantContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("instanceName", instanceName)
+ .add("ecompInstanceId", ecompInstanceId)
+ .add("ecompInstanceName", ecompInstanceName)
+ .add("operationalEnvironmentType", operationalEnvironmentType)
+ .add("tenantContext", tenantContext)
+ .add("workloadContext", workloadContext)
+ .toString();
+ }
+ }
+
+ private void debugEnd(RestObject<RequestReferencesContainer> msoResponse) {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodCallerName(), msoResponse);
+ }
+
+ private void debugStart(Object requestInfo) {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodCallerName(), requestInfo);
+ }
+
+ private void verifyIsNotEmpty(String fieldValue, String fieldName) throws MissingServletRequestParameterException {
+ if (StringUtils.isEmpty(fieldValue)) {
+ throw new MissingServletRequestParameterException(fieldName, "String");
+ }
+ }
+
+ public static class BadManifestException extends RuntimeException {
+ public BadManifestException(String message) {
+ super(message);
+ }
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java b/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
index 83e177a61..4e9ec2539 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/PolicyController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PolicyController.java
@@ -18,21 +18,12 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.controller;
-
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
+package org.onap.vid.controller;
import org.json.simple.JSONObject;
import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.policy.PolicyProperties;
-import org.openecomp.vid.policy.PolicyResponseWrapper;
-import org.openecomp.vid.policy.PolicyRestInterfaceFactory;
-import org.openecomp.vid.policy.PolicyRestInterfaceIfc;
-import org.openecomp.vid.policy.PolicyUtil;
-import org.openecomp.vid.policy.RestObject;
+import org.onap.vid.policy.*;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
@@ -40,6 +31,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
+import javax.servlet.http.HttpServletRequest;
+import java.util.UUID;
+
/**
* Controller to handle Policy requests.
*/
@@ -48,18 +42,18 @@ import org.springframework.web.bind.annotation.RestController;
public class PolicyController extends RestrictedBaseController{
/** The logger. */
- static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyController.class);
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PolicyController.class);
@RequestMapping(value="/get_policy",method = RequestMethod.POST)
public ResponseEntity<String> getPolicyInfo( HttpServletRequest request, @RequestBody JSONObject policy_request) throws Exception {
- logger.debug("#####################POLICY API CALL STARTED ###############"+ PolicyProperties.POLICY_GET_CONFIG_VAL);
- logger.debug("#####################Policy Request ###############"+policy_request.toString());
+ LOGGER.debug("#####################POLICY API CALL STARTED ###############"+ PolicyProperties.POLICY_GET_CONFIG_VAL);
+ LOGGER.debug("#####################Policy Request ###############"+policy_request.toString());
String path = PolicyProperties.getProperty(PolicyProperties.POLICY_GET_CONFIG_VAL);
PolicyResponseWrapper policyResWrapper = getPolicyConfig(policy_request,path);
- logger.debug("$$$$$$$$$$$$$$$$$$$$$$ " + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
+ LOGGER.debug("$$$$$$$$$$$$$$$$$$$$$$ " + new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.OK).toString());
return ( new ResponseEntity<String>(policyResWrapper.getResponse(), HttpStatus.valueOf(policyResWrapper.getStatus())) );
}
@@ -67,7 +61,7 @@ public class PolicyController extends RestrictedBaseController{
protected static PolicyResponseWrapper getPolicyConfig(JSONObject request, String path) throws Exception {
String methodName = "getPolicyConfig";
String uuid = UUID.randomUUID().toString();
- logger.debug( "starting getPolicyConfig ");
+ LOGGER.debug( "starting getPolicyConfig ");
try {
//STARTING REST API CALL AS AN FACTORY INSTACE
@@ -79,10 +73,10 @@ public class PolicyController extends RestrictedBaseController{
restController.<String>Post(str, request, uuid, path, restObjStr );
PolicyResponseWrapper policyRespWrapper = PolicyUtil.wrapResponse (restObjStr);
- logger.debug( "<== " + methodName + " w=" + policyRespWrapper.getResponse());
+ LOGGER.debug( "<== " + methodName + " w=" + policyRespWrapper.getResponse());
return policyRespWrapper;
} catch (Exception e) {
- logger.debug( "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
+ LOGGER.debug( "EXCEPTION in getPolicyConfig <== " + "." + methodName + e.toString());
throw e;
}
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
index 90080769b..2d282edb8 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/PropertyController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/PropertyController.java
@@ -1,122 +1,132 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-/**
- * The Class PropertyController.
- */
-@RestController
-public class PropertyController extends RestrictedBaseController{
-
- /** The view name. */
- String viewName;
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PropertyController.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * Welcome.
- *
- * @param request the request
- * @return the model and view
- */
- @RequestMapping(value = {"/propertyhome" }, method = RequestMethod.GET)
- public ModelAndView welcome(HttpServletRequest request) {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== PropertyController welcome start");
- return new ModelAndView(getViewName());
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
- */
- public String getViewName() {
- return viewName;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
- */
- public void setViewName(String _viewName) {
- this.viewName = _viewName;
- }
-
- /**
- * Gets the property.
- *
- * @param name the name
- * @param defaultvalue the defaultvalue
- * @param request the request
- * @return the property
- * @throws Exception the exception
- */
- @RequestMapping(value = "/get_property/{name}/{defaultvalue}", method = RequestMethod.GET)
- public ResponseEntity<String> getProperty (@PathVariable("name") String name, @PathVariable("defaultvalue") String defaultvalue,
- HttpServletRequest request) throws Exception {
-
- String methodName = "getProperty";
- ResponseEntity<String> resp = null;
- String pvalue = null;
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
- // convert "_" to "." in the property name
- if (name == null || name.length() == 0 ) {
- return ( new ResponseEntity<String> (defaultvalue, HttpStatus.OK));
- }
- // convert "_" to "." in the property name
- String propertyName = name.replace('_', '.');
- pvalue = SystemProperties.getProperty(propertyName);
- if ( ( pvalue == null ) || ( pvalue.length() == 0 ) ) {
- pvalue = defaultvalue;
- }
- resp = new ResponseEntity<String>(pvalue, HttpStatus.OK);
- }
- catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " returning " + pvalue);
- return ( resp );
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.model.CategoryParameter.Family;
+import org.onap.vid.services.CategoryParameterService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * The Class PropertyController.
+ */
+@RestController
+public class PropertyController extends RestrictedBaseController{
+
+
+ /** The logger. */
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PropertyController.class);
+
+ /** The Constant dateFormat. */
+ final protected static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ @Autowired
+ protected CategoryParameterService categoryParameterService;
+
+
+ /**
+ * Welcome.
+ *
+ * @param request the request
+ * @return the model and view
+ */
+ @RequestMapping(value = {"/propertyhome" }, method = RequestMethod.GET)
+ public ModelAndView welcome(HttpServletRequest request) {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== PropertyController welcome start");
+ return new ModelAndView(getViewName());
+ }
+
+ /**
+ * Gets the property.
+ *
+ * @param name the name
+ * @param defaultvalue the defaultvalue
+ * @param request the request
+ * @return the property
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/get_property/{name}/{defaultvalue}", method = RequestMethod.GET)
+ public ResponseEntity<String> getProperty (@PathVariable("name") String name, @PathVariable("defaultvalue") String defaultvalue,
+ HttpServletRequest request) throws Exception {
+
+ String methodName = "getProperty";
+ ResponseEntity<String> resp = null;
+ String pvalue = null;
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ try {
+ // convert "_" to "." in the property name
+ if (name == null || name.length() == 0 ) {
+ return ( new ResponseEntity<String> (defaultvalue, HttpStatus.OK));
+ }
+ // convert "_" to "." in the property name
+ String propertyName = name.replace('_', '.');
+ pvalue = SystemProperties.getProperty(propertyName);
+ if ( ( pvalue == null ) || ( pvalue.length() == 0 ) ) {
+ pvalue = defaultvalue;
+ }
+ resp = new ResponseEntity<String>(pvalue, HttpStatus.OK);
+ }
+ catch (Exception e) {
+ LOGGER.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " returning " + pvalue);
+ return ( resp );
+ }
+
+ /**
+ * Gets the owning entity properties.
+ * @param request the request
+ * @return the property
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/category_parameter", method = RequestMethod.GET)
+ public ResponseEntity getCategoryParameter(HttpServletRequest request, @RequestParam(value="familyName", required = true) Family familyName) throws Exception {
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "start {}({})", getMethodName());
+ try {
+ CategoryParametersResponse response = categoryParameterService.getCategoryParameters(familyName);
+ LOGGER.debug(EELFLoggerDelegate.debugLogger, "end {}() => {}", getMethodName(), response);
+ return new ResponseEntity<>(response, HttpStatus.OK);
+ }
+ catch (Exception exception) {
+ LOGGER.error("failed to retrieve category parameter list from DB.", exception);
+ return new ResponseEntity<>(HttpStatus.INTERNAL_SERVER_ERROR);
+ }
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java b/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java
new file mode 100644
index 000000000..3e15153ac
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/RoleGeneratorController.java
@@ -0,0 +1,31 @@
+package org.onap.vid.controller;
+
+import fj.test.Bool;
+import org.json.JSONObject;
+import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
+import org.onap.vid.services.RoleGeneratorService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletRequest;
+
+@RestController
+public class RoleGeneratorController extends UnRestrictedBaseController {
+ @Autowired
+ private RoleGeneratorService roleGeneratorService;
+ public static final String GENERATE_ROLE_SCRIPT = "generateRoleScript";
+ @RequestMapping(value = GENERATE_ROLE_SCRIPT +"/{firstRun}", method = RequestMethod.GET )
+ public ResponseEntity<String> generateRoleScript (@PathVariable("firstRun") boolean firstRun) throws Exception {
+ ResponseEntity<String> response = null;
+ String query = roleGeneratorService.generateRoleScript(firstRun);
+ response = new ResponseEntity<String>(query, HttpStatus.OK);
+ return response;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java b/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
index f21036eb3..c93d8027f 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/VidController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/VidController.java
@@ -1,119 +1,149 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.SecureServices;
-import org.openecomp.vid.exceptions.VidServiceUnavailableException;
-import org.openecomp.vid.model.ServiceModel;
-import org.openecomp.vid.roles.Role;
-import org.openecomp.vid.roles.RoleProvider;
-import org.openecomp.vid.roles.RoleValidator;
-import org.openecomp.vid.services.VidService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.List;
-import java.util.Map;
-
-//import org.openecomp.vid.model.Service;
-
-@RestController
-public class VidController extends RestrictedBaseController {
-
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidController.class);
-
- private final VidService service;
-
- @Autowired
- public VidController(VidService vidService) throws SdcToscaParserException{
-
- service = vidService;
- }
-//
- /**
- * Gets the services.
- *
- * @param request the request
- * @return the services
- * @throws VidServiceUnavailableException the vid service unavailable exception
- */
- @RequestMapping(value={"/rest/models/services"}, method = RequestMethod.GET)
- public SecureServices getServices(HttpServletRequest request) throws VidServiceUnavailableException {
- try {
- LOG.info("Start API for browse ASDC was called");
- SecureServices secureServices = new SecureServices();
- RoleProvider roleProvider = new RoleProvider();
- Map<String, String[]> requestParams = request.getParameterMap();
- List<Role> roles = new RoleProvider().getUserRoles(request);
- secureServices.setServices(service.getServices(requestParams));
- //Disable roles until AAF integration finishes
- //secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
- return secureServices;
- } catch (AsdcCatalogException e) {
- LOG.error("Failed to retrieve service definitions from SDC", e);
- throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
- } catch (Throwable t) {
- LOG.debug("Unexpected error while retrieving service definitions from SDC: " + t.getMessage() + ":", t);
- t.printStackTrace();
- throw new VidServiceUnavailableException("Unexpected error while retrieving service definitions from SDC: " + t.getMessage(), t);
- }
- }
-
- /**
- * Gets the services.
- *
- * @param uuid the uuid
- * @return the services
- * @throws VidServiceUnavailableException the vid service unavailable exception
- */
- @RequestMapping(value={"/rest/models/services/{uuid}"}, method = RequestMethod.GET)
- public ServiceModel getServices(@PathVariable("uuid") String uuid, HttpServletRequest request) throws VidServiceUnavailableException {
- try {
-// RoleValidator roleValidator = new RoleValidator(new RoleProvider().getUserRoles(request));
- return service.getService(uuid);
- } catch (AsdcCatalogException e) {
- LOG.error("Failed to retrieve service definitions from SDC", e);
- throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
- }
- }
-
-
- /**
- * Gets the services view.
- *
- * @param request the request
- * @return the services view
- * @throws VidServiceUnavailableException the vid service unavailable exception
- */
- @RequestMapping(value={"/serviceModels"}, method=RequestMethod.GET)
- public ModelAndView getServicesView(HttpServletRequest request) throws VidServiceUnavailableException {
- return new ModelAndView("serviceModels");
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.SecureServices;
+import org.onap.vid.exceptions.VidServiceUnavailableException;
+import org.onap.vid.model.ServiceModel;
+import org.onap.vid.roles.Role;
+import org.onap.vid.roles.RoleProvider;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.services.VidService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.List;
+
+//import org.onap.vid.model.Service;
+
+@RestController
+public class VidController extends RestrictedBaseController {
+
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidController.class);
+
+ private final VidService service;
+
+ @Autowired
+ public VidController(VidService vidService) throws SdcToscaParserException{
+
+ service = vidService;
+ }
+
+ @Autowired
+ private AaiService aaiService;
+
+ @Autowired
+ RoleProvider roleProvider;
+
+// /**
+// * Gets the services.
+// *
+// * @param request the request
+// * @return the services
+// * @throws VidServiceUnavailableException the vid service unavailable exception
+// */
+// @RequestMapping(value={"/rest/models/services"}, method = RequestMethod.GET)
+// public SecureServices getServices(HttpServletRequest request) throws VidServiceUnavailableException {
+// try {
+// AaiService aaiService = new AaiServiceImpl();
+// LOG.info("Start API for browse ASDC was called");
+// SecureServices secureServices = new SecureServices();
+// Map<String, String[]> requestParams = request.getParameterMap();
+// List<Role> roles = roleProvider.getUserRoles(request);
+// secureServices.setServices(aaiService.getServicesByDistributionStatus());
+// secureServices.setServices(service.getServices(requestParams));
+// secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
+// return secureServices;
+// } catch (AsdcCatalogException e) {
+// LOG.error("Failed to retrieve service definitions from SDC", e);
+// throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
+// } catch (Throwable t) {
+// LOG.debug("Unexpected error while retrieving service definitions from SDC: " + t.getMessage() + ":", t);
+// t.printStackTrace();
+// throw new VidServiceUnavailableException("Unexpected error while retrieving service definitions from SDC: " + t.getMessage(), t);
+// }
+// }
+
+ /**
+ * Gets the services.
+ *
+ * @param request the request
+ * @return the services
+ * @throws VidServiceUnavailableException the vid service unavailable exception
+ */
+ @RequestMapping(value={"/rest/models/services"}, method = RequestMethod.GET)
+ public SecureServices getServices(HttpServletRequest request) throws VidServiceUnavailableException {
+ try {
+ LOG.info("Start API for browse ASDC was called");
+ SecureServices secureServices = new SecureServices();
+ List<Role> roles = roleProvider.getUserRoles(request);
+ secureServices.setServices(aaiService.getServicesByDistributionStatus());
+ secureServices.setReadOnly(roleProvider.userPermissionIsReadOnly(roles));
+ return secureServices;
+ }
+ catch (Exception t) {
+ LOG.debug("Unexpected error while retrieving service definitions from A&AI: " + t.getMessage() + ":", t);
+ t.printStackTrace();
+ throw new VidServiceUnavailableException("Unexpected error while retrieving service definitions from A&AI: " + t.getMessage(), t);
+ }
+ }
+
+
+
+ /**
+ * Gets the services.
+ *
+ * @param uuid the uuid
+ * @return the services
+ * @throws VidServiceUnavailableException the vid service unavailable exception
+ */
+ @RequestMapping(value={"/rest/models/services/{uuid}"}, method = RequestMethod.GET)
+ public ServiceModel getServices(@PathVariable("uuid") String uuid, HttpServletRequest request) throws VidServiceUnavailableException {
+ try {
+ return service.getService(uuid);
+ } catch (AsdcCatalogException e) {
+ LOG.error("Failed to retrieve service definitions from SDC", e);
+ throw new VidServiceUnavailableException("Failed to retrieve service definitions from SDC", e);
+ }
+ }
+
+
+ /**
+ * Gets the services view.
+ *
+ * @param request the request
+ * @return the services view
+ * @throws VidServiceUnavailableException the vid service unavailable exception
+ */
+ @RequestMapping(value={"/serviceModels"}, method=RequestMethod.GET)
+ public ModelAndView getServicesView(HttpServletRequest request) throws VidServiceUnavailableException {
+ return new ModelAndView("serviceModels");
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java b/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
index 31e64983e..4a87df10d 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewLogController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/ViewLogController.java
@@ -1,84 +1,65 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-
-/**
- * The Class ViewLogController.
- */
-@RestController
-public class ViewLogController extends RestrictedBaseController{
-
- /** The view name. */
- String viewName;
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ViewLogController.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The servlet context. */
- private @Autowired ServletContext servletContext;
-
- /**
- * Welcome.
- *
- * @param request the request
- * @return the model and view
- */
- @RequestMapping(value = {"/viewlog" }, method = RequestMethod.GET)
- public ModelAndView welcome(HttpServletRequest request) {
-
- return new ModelAndView(getViewName());
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
- */
- public String getViewName() {
- return viewName;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
- */
- public void setViewName(String viewName) {
- this.viewName = viewName;
- }
-
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RestController;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+
+/**
+ * The Class ViewLogController.
+ */
+@RestController
+public class ViewLogController extends RestrictedBaseController{
+
+ /** The logger. */
+ private static final EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(ViewLogController.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /** The servlet context. */
+ private @Autowired ServletContext servletContext;
+
+ /**
+ * Welcome.
+ *
+ * @param request the request
+ * @return the model and view
+ */
+ @RequestMapping(value = {"/viewlog" }, method = RequestMethod.GET)
+ public ModelAndView welcome(HttpServletRequest request) {
+
+ return new ModelAndView(getViewName());
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
index 1e13d0eb6..2838e7f3c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/WebConfig.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/WebConfig.java
@@ -1,22 +1,22 @@
-package org.openecomp.vid.controller;
+package org.onap.vid.controller;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.io.IOUtils;
import org.json.JSONObject;
import org.json.JSONTokener;
-import org.openecomp.vid.aai.AaiClient;
-import org.openecomp.vid.aai.AaiClientInterface;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.local.LocalAsdcClient;
-import org.openecomp.vid.asdc.memory.InMemoryAsdcClient;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl2;
-import org.openecomp.vid.asdc.rest.RestfulAsdcClient;
-import org.openecomp.vid.properties.AsdcClientConfiguration;
-import org.openecomp.vid.properties.AsdcClientConfiguration.AsdcClientType;
-import org.openecomp.vid.services.AaiService;
-import org.openecomp.vid.services.AaiServiceImpl;
-import org.openecomp.vid.services.VidService;
-import org.openecomp.vid.services.VidServiceImpl;
+import org.onap.vid.aai.AaiClient;
+import org.onap.vid.aai.AaiClientInterface;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.local.LocalAsdcClient;
+import org.onap.vid.asdc.memory.InMemoryAsdcClient;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+import org.onap.vid.asdc.rest.RestfulAsdcClient;
+import org.onap.vid.properties.AsdcClientConfiguration;
+import org.onap.vid.properties.AsdcClientConfiguration.AsdcClientType;
+import org.onap.vid.services.AaiService;
+import org.onap.vid.services.AaiServiceImpl;
+import org.onap.vid.services.VidService;
+import org.onap.vid.services.VidServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -46,6 +46,7 @@ public class WebConfig {
+
@Bean
public VidService vidService(AsdcClient asdcClient) {
return new VidServiceImpl(asdcClient);
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java b/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java
new file mode 100644
index 000000000..a83fa281b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/filter/PromiseEcompRequestIdFilter.java
@@ -0,0 +1,94 @@
+package org.onap.vid.controller.filter;
+
+
+import com.google.common.collect.ImmutableList;
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.web.filter.GenericFilterBean;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.UUID;
+
+import static org.openecomp.portalsdk.core.util.SystemProperties.ECOMP_REQUEST_ID;
+
+@WebFilter(urlPatterns = "/*")
+public class PromiseEcompRequestIdFilter extends GenericFilterBean {
+
+ private final static EELFLoggerDelegate LOGGER = EELFLoggerDelegate.getLogger(PromiseEcompRequestIdFilter.class);
+ private final static String REQUEST_ID_RESPONSE_HEADER = ECOMP_REQUEST_ID + "-echo";
+
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
+ throws IOException, ServletException {
+
+ if (request instanceof HttpServletRequest) {
+ request = wrapIfNeeded(request);
+
+ if (response instanceof HttpServletResponse) {
+ final String actualRequestId = ((HttpServletRequest) request).getHeader(ECOMP_REQUEST_ID);
+ ((HttpServletResponse) response).addHeader(REQUEST_ID_RESPONSE_HEADER, actualRequestId);
+ }
+ }
+
+ chain.doFilter(request, response);
+ }
+
+ public static ServletRequest wrapIfNeeded(ServletRequest request) {
+ final HttpServletRequest httpRequest = (HttpServletRequest) request;
+ final String originalRequestId = httpRequest.getHeader(ECOMP_REQUEST_ID);
+
+ if (StringUtils.isEmpty(originalRequestId)) {
+ request = new PromiseEcompRequestIdRequestWrapper(httpRequest);
+ }
+
+ return request;
+ }
+
+ private static class PromiseEcompRequestIdRequestWrapper extends HttpServletRequestWrapper {
+
+ private final UUID requestId;
+
+ PromiseEcompRequestIdRequestWrapper(HttpServletRequest request) {
+ super(request);
+ requestId = UUID.randomUUID();
+ }
+
+ @Override
+ public String getHeader(String name) {
+ return isRequestIdHeaderName(name) ?
+ requestId.toString() : super.getHeader(name);
+ }
+
+ @Override
+ public Enumeration<String> getHeaders(String name) {
+ if (isRequestIdHeaderName(name)) {
+ return Collections.enumeration(Collections.singleton(requestId.toString()));
+ } else {
+ return super.getHeaders(name);
+ }
+ }
+
+ @Override
+ public Enumeration<String> getHeaderNames() {
+ return Collections.enumeration(ImmutableList.<String>builder()
+ .add(ECOMP_REQUEST_ID)
+ .addAll(Collections.list(super.getHeaderNames()))
+ .build());
+ }
+
+ private boolean isRequestIdHeaderName(String name) {
+ return ECOMP_REQUEST_ID.equalsIgnoreCase(name);
+ }
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java b/vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java
new file mode 100644
index 000000000..02dcde095
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/filter/TempFilterForCORS.java
@@ -0,0 +1,48 @@
+package org.onap.vid.controller.filter;
+
+import org.apache.commons.lang3.StringUtils;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.web.filter.GenericFilterBean;
+
+import javax.servlet.FilterChain;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.annotation.WebFilter;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+@WebFilter(urlPatterns = "/*")
+public class TempFilterForCORS extends GenericFilterBean {
+
+ private static final String ENV_MODE = "env.mode";
+ private Boolean devMode = null;
+
+ //dev mode is initialized here since @WebFilter doesn't support @Autowired
+ //So we are sure that SystemProperties bean was initialed only after the first call to doFilter
+ private boolean isDevMode() {
+ if (devMode!=null) {
+ return devMode;
+ }
+ else {
+ if (!SystemProperties.containsProperty(ENV_MODE)) {
+ devMode = Boolean.FALSE;
+ return devMode;
+ }
+
+ String envMode = SystemProperties.getProperty(ENV_MODE);
+ devMode = StringUtils.equalsIgnoreCase(envMode, "dev") ;
+ }
+ return devMode;
+ }
+
+ @Override
+ public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
+
+ if (isDevMode() && response instanceof HttpServletResponse) {
+ ((HttpServletResponse) response).addHeader("Access-Control-Allow-Origin", "http://localhost:3000");
+ ((HttpServletResponse) response).addHeader("Access-Control-Allow-Credentials", "true");
+ }
+ chain.doFilter(request, response);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
index 79017410c..29e7a4d7d 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAaiController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAaiController.java
@@ -1,93 +1,87 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller.test;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/**
- * The Class TestAaiController.
- */
-@RestController
-@RequestMapping("testaai")
-public class TestAaiController extends RestrictedBaseController {
-
- /**
- * Gets the subscription service type list.
- *
- * @param globalCustomerId the global customer id
- * @param request the request
- * @return the subscription service type list
- * @throws Exception the exception
- */
- @RequestMapping(value = "/getSubscriptionServiceTypeList/{globalCustomerId}", method = RequestMethod.GET)
- public String getSubscriptionServiceTypeList(@PathVariable("globalCustomerId") String globalCustomerId, HttpServletRequest request)
- throws Exception {
-
- System.err.println("GET SUBSCRIPTION SERVICE TYPE LIST: globalCustomerId: " + globalCustomerId);
-
- return "[\"vMOG\", \"sevice type 2\", \"sevice type 3\", \"sevice type 4\"]";
- }
-
- /**
- * Exception.
- *
- * @param e the e
- * @param response the response
- * @throws IOException Signals that an I/O exception has occurred.
- */
- @ExceptionHandler(Exception.class)
- private void exception(Exception e, HttpServletResponse response) throws IOException {
-
- /*
- * This logging step should preferably be replaced with an appropriate
- * logging method consistent whatever logging mechanism the rest of the
- * application code uses.
- */
-
- e.printStackTrace(System.err);
-
- response.setContentType("application/json; charset=UTF-8");
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
- ExceptionResponse exceptionResponse = new ExceptionResponse();
- exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
- exceptionResponse.setMessage(e.getMessage());
-
- response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
- response.flushBuffer();
-
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller.test;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.vid.model.ExceptionResponse;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * The Class TestAaiController.
+ */
+@RestController
+@RequestMapping("testaai")
+public class TestAaiController extends RestrictedBaseController {
+
+ /**
+ * Gets the subscription service type list.
+ *
+ * @param globalCustomerId the global customer id
+ * @param request the request
+ * @return the subscription service type list
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/getSubscriptionServiceTypeList/{globalCustomerId}", method = RequestMethod.GET)
+ public String getSubscriptionServiceTypeList(@PathVariable("globalCustomerId") String globalCustomerId, HttpServletRequest request)
+ throws Exception {
+
+ System.err.println("GET SUBSCRIPTION SERVICE TYPE LIST: globalCustomerId: " + globalCustomerId);
+
+ return "[\"vMOG\", \"sevice type 2\", \"sevice type 3\", \"sevice type 4\"]";
+ }
+
+ /**
+ * Exception.
+ *
+ * @param e the e
+ * @param response the response
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @ExceptionHandler(Exception.class)
+ private void exception(Exception e, HttpServletResponse response) throws IOException {
+
+ /*
+ * This logging step should preferably be replaced with an appropriate
+ * logging method consistent whatever logging mechanism the rest of the
+ * application code uses.
+ */
+
+ e.printStackTrace(System.err);
+
+ response.setContentType("application/json; charset=UTF-8");
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+ ExceptionResponse exceptionResponse = new ExceptionResponse();
+ exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+ exceptionResponse.setMessage(e.getMessage());
+
+ response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+ response.flushBuffer();
+
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
index 84a56b3b2..2b289b91a 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestAsdcController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestAsdcController.java
@@ -1,112 +1,106 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller.test;
-
-import java.io.IOException;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/**
- * The Class TestAsdcController.
- */
-@RestController
-@RequestMapping("testasdc")
-public class TestAsdcController extends RestrictedBaseController {
-
- /**
- * Gets the model.
- *
- * @param modelId the model id
- * @param request the request
- * @return the model
- * @throws Exception the exception
- */
- @RequestMapping(value = "/getModel/{modelId}", method = RequestMethod.GET)
- public String getModel(@PathVariable("modelId") String modelId, HttpServletRequest request) throws Exception {
-
- System.err.println("SDC: GET MODEL: modelId: " + modelId);
-
- // @formatter:off
- return
- "{" +
- "\"uuid\": \"5be686dc-fdca-4d54-8548-5d0ed23e962b\"," +
- "\"invariantUUID\": \"e5962da9-fe4f-433a-bc99-b43e0d88a9a1\"," +
- "\"name\": \"DE220127\"," +
- "\"version\": \"0.1\"," +
- "\"inputs\": {" +
- "\"defaultGateway\": {" +
- "\"type\": \"String\"," +
- "\"default\": \"192.168.1.1\"," +
- "\"description\": \"Router default gateway - use any valid IPv4 address\"" +
- "}," +
- "\"subnetMask\": {" +
- "\"type\": \"String\"," +
- "\"default\": \"255.255.255.0\"," +
- "\"description\": \"Router subnet mask - example (255.255.255.0)\"" +
- "}" +
- "}" +
- "}";
- // @formatter:on
- }
-
- /**
- * Exception.
- *
- * @param e the e
- * @param response the response
- * @throws IOException Signals that an I/O exception has occurred.
- */
- @ExceptionHandler(Exception.class)
- private void exception(Exception e, HttpServletResponse response) throws IOException {
-
- /*
- * This logging step should preferably be replaced with an appropriate
- * logging method consistent whatever logging mechanism the rest of the
- * application code uses.
- */
-
- e.printStackTrace(System.err);
-
- response.setContentType("application/json; charset=UTF-8");
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
- ExceptionResponse exceptionResponse = new ExceptionResponse();
- exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
- exceptionResponse.setMessage(e.getMessage());
-
- response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
- response.flushBuffer();
-
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller.test;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.vid.model.ExceptionResponse;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ * The Class TestAsdcController.
+ */
+@RestController
+@RequestMapping("testasdc")
+public class TestAsdcController extends RestrictedBaseController {
+
+ /**
+ * Gets the model.
+ *
+ * @param modelId the model id
+ * @param request the request
+ * @return the model
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/getModel/{modelId}", method = RequestMethod.GET)
+ public String getModel(@PathVariable("modelId") String modelId, HttpServletRequest request) throws Exception {
+
+ System.err.println("SDC: GET MODEL: modelId: " + modelId);
+
+ // @formatter:off
+ return
+ "{" +
+ "\"uuid\": \"5be686dc-fdca-4d54-8548-5d0ed23e962b\"," +
+ "\"invariantUUID\": \"e5962da9-fe4f-433a-bc99-b43e0d88a9a1\"," +
+ "\"name\": \"DE220127\"," +
+ "\"version\": \"0.1\"," +
+ "\"inputs\": {" +
+ "\"defaultGateway\": {" +
+ "\"type\": \"String\"," +
+ "\"default\": \"192.168.1.1\"," +
+ "\"description\": \"Router default gateway - use any valid IPv4 address\"" +
+ "}," +
+ "\"subnetMask\": {" +
+ "\"type\": \"String\"," +
+ "\"default\": \"255.255.255.0\"," +
+ "\"description\": \"Router subnet mask - example (255.255.255.0)\"" +
+ "}" +
+ "}" +
+ "}";
+ // @formatter:on
+ }
+
+ /**
+ * Exception.
+ *
+ * @param e the e
+ * @param response the response
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @ExceptionHandler(Exception.class)
+ private void exception(Exception e, HttpServletResponse response) throws IOException {
+
+ /*
+ * This logging step should preferably be replaced with an appropriate
+ * logging method consistent whatever logging mechanism the rest of the
+ * application code uses.
+ */
+
+ e.printStackTrace(System.err);
+
+ response.setContentType("application/json; charset=UTF-8");
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+ ExceptionResponse exceptionResponse = new ExceptionResponse();
+ exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+ exceptionResponse.setMessage(e.getMessage());
+
+ response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+ response.flushBuffer();
+
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
index 02c29f678..9d6a3de9c 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestMsoController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestMsoController.java
@@ -1,729 +1,723 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller.test;
-
-import java.io.IOException;
-import java.util.stream.Collectors;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.codehaus.jackson.map.ObjectMapper;
-import org.openecomp.vid.model.ExceptionResponse;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.ExceptionHandler;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/*
- * The "TestMsoController" class is primarily designed to help test "msoCommitController.js"
- *
- * This class expects and receives JSON data in the same format as expected
- * in the "real" application version of this code. However, string versions of JSON are
- * maintained internally here instead of marshalled / unmarshalled JSON objects.
- * The primary reasons for this were to encapsulate all the test code in this single file and
- * minimize the time required to support initial test cases.
- *
- * The non-test equivalent of this controller could alternatively incorporate POJO objects
- * instead of strings. However, the same data format sent to / received from the browser
- * JavaScript code would still be expected.
- *
- * Two specific mechanisms used in this test class may be useful to the application version:
- *
- * 1) The use of "{variable}" elements in @RequestMappings along with the corresponding
- * @PathVariable declarations.
- *
- * 2) The use of @ExceptionHandler for general purpose exception handler.
- * (See @ExceptionHandler comments)
- *
- * This class is intended to be used in either:
- *
- * A) Eclipse environments
- * OR
- * B) Linux environments with ONLY a single user running tests.
- * The "quick and dirty" error simulation approach used here makes use of static states for some
- * scenarios. Thus multiple users simultaneously testing in Linux environments
- * may have contention issues.
- */
-
-/**
- * The Class TestMsoController.
- */
-@RestController
-@RequestMapping("testmso")
-public class TestMsoController extends RestrictedBaseController {
-
- /*
- * Artificial delay (in milliseconds) added before responding to create /
- * delete requests
- */
-
- /** The Constant TEST_DELAY_SHORT_MSEC. */
- private final static int TEST_DELAY_SHORT_MSEC = 1000;
-
- /*
- * Long delay to simulate non-responsive server test
- */
-
- /** The Constant TEST_DELAY_LONG_MSEC. */
- private final static int TEST_DELAY_LONG_MSEC = 15000;
-
- /*
- * Default number of polls expected before transaction complete.
- */
-
- /** The Constant MAXIMUM_POLLS_DEFAULT. */
- private final static int MAXIMUM_POLLS_DEFAULT = 4;
-
- /*
- * Number of polls to simulate "maximum polls exceeded" test.
- */
-
- /** The Constant MAXIMUM_POLLS_LARGE. */
- private final static int MAXIMUM_POLLS_LARGE = 10;
-
- /*
- * Simulated error types. The GUI front end is expected to set these values
- * in the "modelName" field of the "mso_create_svc_instance" request.
- */
-
- /** The Constant ERROR_POLICY_EXCEPTION. */
- private final static String ERROR_POLICY_EXCEPTION = "ERROR_POLICY_EXCEPTION";
-
- /** The Constant ERROR_SERVICE_EXCEPTION. */
- private final static String ERROR_SERVICE_EXCEPTION = "ERROR_SERVICE_EXCEPTION";
-
- /** The Constant ERROR_POLL_FAILURE. */
- private final static String ERROR_POLL_FAILURE = "ERROR_POLL_FAILURE";
-
- /** The Constant ERROR_INVALID_FIELD_INITIAL. */
- private final static String ERROR_INVALID_FIELD_INITIAL = "ERROR_INVALID_FIELD_INITIAL";
-
- /** The Constant ERROR_INVALID_FIELD_POLL. */
- private final static String ERROR_INVALID_FIELD_POLL = "ERROR_INVALID_FIELD_POLL";
-
- /** The Constant ERROR_GENERAL_SERVER_EXCEPTION. */
- private final static String ERROR_GENERAL_SERVER_EXCEPTION = "ERROR_GENERAL_SERVER_EXCEPTION";
-
- /** The Constant ERROR_MAX_POLLS. */
- private final static String ERROR_MAX_POLLS = "ERROR_MAX_POLLS";
-
- /** The Constant ERROR_SERVER_TIMEOUT_INITIAL. */
- private final static String ERROR_SERVER_TIMEOUT_INITIAL = "ERROR_SERVER_TIMEOUT_INITIAL";
-
- /** The Constant ERROR_SERVER_TIMEOUT_POLL. */
- private final static String ERROR_SERVER_TIMEOUT_POLL = "ERROR_SERVER_TIMEOUT_POLL";
-
- /** The simulated error. */
- private String simulatedError = "";
-
- /** The maximum polls. */
- private int maximumPolls = 0;
-
- /** The attempt count. */
- private int attemptCount = 0;
-
- /**
- * Creates the svc instance.
- *
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
- public ResponseEntity<String> createSvcInstance(HttpServletRequest request) throws Exception {
- readAndLogRequest("CREATE SERVICE INSTANCE", request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
-
- /*
- * This block of code simulates various errors and would NOT be expected
- * in a non-test method
- */
- System.err.println("simulatedError: " + simulatedError);
-
- if (simulatedError.equals(ERROR_POLICY_EXCEPTION)) {
- return new ResponseEntity<String>(policyExceptionResponse, HttpStatus.OK);
- }
- if (simulatedError.equals(ERROR_SERVICE_EXCEPTION)) {
- return new ResponseEntity<String>(serviceExceptionResponse, HttpStatus.OK);
- }
- if (simulatedError.equals(ERROR_INVALID_FIELD_INITIAL)) {
- /*
- * Force invalid response field name. Return
- * "XXXXXrequestReferences" instead of "requestReferences"
- */
- return new ResponseEntity<String>(acceptResponse.replace("requestReferences", "XXXXXrequestReferences"),
- HttpStatus.OK);
- }
-
- if (simulatedError.equals(ERROR_GENERAL_SERVER_EXCEPTION)) {
- throw new IOException("an example of an IO exception");
- }
-
- if (simulatedError.equals(ERROR_SERVER_TIMEOUT_INITIAL)) {
- Thread.sleep(TEST_DELAY_LONG_MSEC);
- }
-
- if (simulatedError.equals(ERROR_MAX_POLLS)) {
- maximumPolls = MAXIMUM_POLLS_LARGE;
- }
-
- /*
- * End of block of simulated error code.
- */
-
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Delete svc instance.
- *
- * @param serviceInstanceId the service instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- HttpServletRequest request) throws Exception {
- readAndLogRequest("DELETE SERVICE INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Creates the vnf instance.
- *
- * @param serviceInstanceId the service instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- HttpServletRequest request) throws Exception {
- readAndLogRequest("CREATE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Delete vnf instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
- readAndLogRequest(
- "DELETE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: " + vnfInstanceId,
- request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Creates the vf module instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules
- @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
- readAndLogRequest("CREATE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
- + vnfInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Delete vf module instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param vfModuleInstanceId the vf module instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff
- @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("vnfInstanceId") String vnfInstanceId,
- @PathVariable("vfModuleInstanceId") String vfModuleInstanceId, HttpServletRequest request)
- throws Exception {
- readAndLogRequest("DELETE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
- + vnfInstanceId + " vfModuleInstanceId: " + vfModuleInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- // POST
- /**
- * Creates the volume group instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups
- @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
- readAndLogRequest("CREATE VOLUME GROUP INSTANCE: seviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
- + vnfInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Delete volume group instance.
- *
- * @param serviceInstanceId the service instance id
- * @param vnfInstanceId the vnf instance id
- * @param volumeGroupInstanceId the volume group instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups/ff305d54-75b4-ff1b-cdb2-eb6b9e5460ff
- @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("vnfInstanceId") String vnfInstanceId,
- @PathVariable("volumeGroupInstanceId") String volumeGroupInstanceId, HttpServletRequest request)
- throws Exception {
- readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
- + vnfInstanceId + " volumeGroupInstanceId: " + volumeGroupInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Creates the nw instance.
- *
- * @param serviceInstanceId the service instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- HttpServletRequest request) throws Exception {
- readAndLogRequest("CREATE NW INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Delete nw instance.
- *
- * @param serviceInstanceId the service instance id
- * @param networkInstanceId the network instance id
- * @param request the request
- * @return the response entity
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
- public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
- @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request) throws Exception {
- readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " networkInstanceId: "
- + networkInstanceId, request);
- Thread.sleep(TEST_DELAY_SHORT_MSEC);
- maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
- attemptCount = 0;
- return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
- }
-
- /**
- * Gets the orchestration request.
- *
- * @param requestId the request id
- * @param request the request
- * @return the orchestration request
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
- public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
- HttpServletRequest request) throws Exception {
-
- System.err.println("GET ORCHESTRATION REQUEST: requestId: " + requestId);
-
- /*
- * This block of code simulates various errors and would NOT be expected
- * in a non-test method
- */
-
- if (simulatedError.equals(ERROR_INVALID_FIELD_POLL)) {
- /*
- * Force invalid response field name. Return "XXXXXrequestStatus"
- * instead of "requestStatus"
- */
- return new ResponseEntity<String>(inProgressResponse.replace("requestStatus", "XXXXXrequestStatus"),
- HttpStatus.OK);
- }
-
- if (simulatedError.equals(ERROR_POLL_FAILURE)) {
- /*
- * Force status field with "Failure"
- */
- return new ResponseEntity<String>(inProgressResponse.replace("InProgress", "Failure"), HttpStatus.OK);
- }
-
- if (simulatedError.equals(ERROR_SERVER_TIMEOUT_POLL)) {
- Thread.sleep(TEST_DELAY_LONG_MSEC);
- }
-
- /*
- * End of block of simulated error code.
- */
-
- /*
- * This logic simulates how MSO might behave ... i.e. return different
- * results depending on the value of 'maximumPolls'.
- *
- */
- int percentProgress = (++attemptCount * 100) / maximumPolls;
-
- System.err.println("attempts: " + attemptCount + " max: " + maximumPolls + " percent: " + percentProgress);
-
- String response = inProgressResponse.replace("\"50\"", "\"" + Integer.toString(percentProgress) + "\"");
-
- if (attemptCount < maximumPolls) {
- if (attemptCount > 1) {
- response = response.replace("vLan setup", "setup step " + Integer.toString(attemptCount));
- }
- return new ResponseEntity<String>(response, HttpStatus.OK);
- } else {
- return new ResponseEntity<String>(
- response.replace("InProgress", "Complete").replace("vLan setup complete", ""), HttpStatus.OK);
- }
- }
-
- /**
- * Gets the orchestration requests.
- *
- * @param filterString the filter string
- * @param request the request
- * @return the orchestration requests
- * @throws Exception the exception
- */
- @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
- public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
- HttpServletRequest request) throws Exception {
-
- System.err.println("GET ORCHESTRATION REQUESTS: filterString: " + filterString);
-
- return new ResponseEntity<String>(getOrchestrationRequestsResponse, HttpStatus.OK);
-
- }
-
- /*
- * General purpose exception handler that could be used in application code.
- *
- * The method returns exceptions as error code 500. Both the exception type
- * and message are written as a JSON object.
- *
- * See the following references:
- *
- * 1) The ExceptionResponse POJO.
- *
- * 2) The "getHttpErrorMessage" function in "utilityService.js" - an example
- * of how the browser JavaScript code can interpret this response.
- */
-
- /**
- * Exception.
- *
- * @param e the e
- * @param response the response
- * @throws IOException Signals that an I/O exception has occurred.
- */
- @ExceptionHandler(Exception.class)
- private void exception(Exception e, HttpServletResponse response) throws IOException {
-
- /*
- * This logging step should preferably be replaced with an appropriate
- * logging method consistent whatever logging mechanism the rest of the
- * application code uses.
- */
-
- e.printStackTrace(System.err);
-
- response.setContentType("application/json; charset=UTF-8");
- response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-
- ExceptionResponse exceptionResponse = new ExceptionResponse();
- exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
- exceptionResponse.setMessage(e.getMessage());
-
- response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
-
- response.flushBuffer();
-
- }
-
- /*
- * 'readAndLogRequest' only intended to be used for testing.
- *
- * The method reads JSON from the input stream and thus prevents other
- * mechanisms from reading the input.
- */
-
- /**
- * Read and log request.
- *
- * @param label the label
- * @param request the request
- * @throws Exception the exception
- */
- private void readAndLogRequest(String label, HttpServletRequest request) throws Exception {
- String input = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
-
- ObjectMapper mapper = new ObjectMapper();
- Object json = mapper.readValue(input, Object.class);
-
- System.err.println(label + "\n" + mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json));
-
- /*
- * Only needed for error simulation ...
- */
- if (input.matches("^.*modelName.*$")) {
- simulatedError = input.replaceAll("^.*\"modelName\":\"", "").replaceAll("\".*$", "");
- }
- }
-
- /*
- * Various test responses:
- */
-
- // @formatter:off
-
- /** The accept response. */
- /*
- * Sample responses to initial create / delete transaction
- */
- private String acceptResponse =
- "{" +
- " \"status\": 202," +
- " \"entity\": {" +
- " \"requestReferences\": {" +
- " \"instanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"," +
- " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e331\"" +
- " }" +
- " }" +
- "}";
-
- /** The policy exception response. */
- private String policyExceptionResponse =
- "{" +
- " \"status\": 400," +
- " \"entity\": { " +
- " \"requestError\": {" +
- " \"policyException\": {" +
- " \"messageId\": \"POL9003\"," +
- " \"text\": \"Message content size exceeds the allowable limit\"" +
- " }" +
- " }" +
- " }" +
- "}";
-
- /** The service exception response. */
- private String serviceExceptionResponse =
- "{" +
- " \"status\": 400," +
- " \"entity\": { " +
- " \"requestError\": {" +
- " \"serviceException\": {" +
- " \"messageId\": \"SVC2000\"," +
- " \"text\": \"Missing Parameter: %1. Error code is %2\"," +
- " \"variables\": [" +
- " \"severity\"," +
- " \"400\"" +
- " ]" +
- " }" +
- " }" +
- " }" +
- "}" +
- "";
-
- /** The in progress response. */
- /*
- * Sample response to subsequent getOrchestrationRequest
- */
- private String inProgressResponse =
- "{" +
- " \"status\": 200," +
- " \"entity\": {" +
- " \"request\": {" +
- " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
- " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
- " \"instanceIds\": {" +
- " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
- " }," +
- " \"requestScope\": \"service\"," +
- " \"requestType\": \"createInstance\"," +
- " \"requestDetails\": {" +
- " \"modelInfo\": {" +
- " \"modelType\": \"service\"," +
- " \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
- " \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
- " \"modelName\": \"WanBonding\"," +
- " \"modelVersion\": \"1\"" +
- " }," +
- " \"subscriberInfo\": {" +
- " \"globalSubscriberId\": \"C12345\"," +
- " \"subscriberName\": \"General Electric Division 12\"" +
- " }," +
- " \"requestParameters\": {" +
- " \"vpnId\": \"1a2b3c4d5e6f\"," +
- " \"productName\": \"Trinity\"," +
- " \"customerId\": \"icore9883749\"" +
- " }" +
- " }," +
- " \"requestStatus\": {" +
- " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\"," +
- " \"requestState\": \"InProgress\"," +
- " \"statusMessage\": \"vLan setup complete\"," +
- " \"percentProgress\": \"50\"" +
- " }" +
- " }" +
- " }" +
- "}";
-
- /*
- * Sample response to subsequent getOrchestrationRequests
- */
-
- /** The get orchestration requests response. */
- private String getOrchestrationRequestsResponse =
- "{" +
- " \"status\": 200," +
- " \"entity\": {" +
- " \"requestList\": [" +
- " {" +
- " \"request\": {" +
- " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
- " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
- " \"finishTime\": \"Thu, 04 Jun 2009 02:55:59 GMT\"," +
- " \"instanceReferences\": {" +
- " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
- " }," +
- " \"requestScope\": \"service\"," +
- " \"requestType\": \"createInstance\"," +
- " \"requestDetails\": {" +
- " \"modelInfo\": {" +
- " \"modelType\": \"service\"," +
- " \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
- " \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
- " \"modelName\": \"WanBonding\"," +
- " \"modelVersion\": \"1\"" +
- " }," +
- " \"subscriberInfo\": {" +
- " \"globalSubscriberId\": \"C12345\"," +
- " \"subscriberName\": \"General Electric Division 12\"" +
- " }," +
- " \"requestParameters\": {" +
- " \"vpnId\": \"1a2b3c4d5e6f\"," +
- " \"productName\": \"Trinity\"," +
- " \"customerId\": \"icore9883749\"" +
- " }" +
- " }," +
- " \"requestStatus\": {" +
- " \"timestamp\": \"Thu, 04 Jun 2009 02:54:49 GMT\"," +
- " \"requestState\": \"complete\"," +
- " \"statusMessage\": \"Resource Created\"," +
- " \"percentProgress\": \"100\"" +
- " }" +
- " }" +
- " }," +
- " {" +
- " \"request\": {" +
- " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e334\"," +
- " \"startTime\": \"Thu, 04 Jun 2009 03:52:59 GMT\"," +
- " \"instanceReferences\": {" +
- " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
- " }," +
- " \"requestScope\": \"service\"," +
- " \"requestType\": \"updateInstance\"," +
- " \"requestDetails\": {" +
- " \"modelInfo\": {" +
- " \"modelType\": \"service\"," +
- " \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
- " \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
- " \"modelName\": \"WanBonding\"," +
- " \"modelVersion\": \"1\"" +
- " }," +
- " \"subscriberInfo\": {" +
- " \"globalSubscriberId\": \"C12345\"," +
- " \"subscriberName\": \"General Electric Division 12\"" +
- " }," +
- " \"requestParameters\": {" +
- " \"vpnId\": \"1a2b3c4d5e70\"," +
- " \"productName\": \"Trinity\"," +
- " \"customerId\": \"icore9883749\"" +
- " }" +
- " }," +
- " \"requestStatus\": {" +
- " \"timestamp\": \"Thu, 04 Jun 2009 03:53:39 GMT\"," +
- " \"requestState\": \"InProgress\"," +
- " \"statusMessage\": \"vLan setup complete\"," +
- " \"percentProgress\": \"50\"" +
- " }" +
- " }" +
- " }" +
- " ]" +
- " }" +
- "}";
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller.test;
+
+import org.codehaus.jackson.map.ObjectMapper;
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.onap.vid.model.ExceptionResponse;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.stream.Collectors;
+
+/*
+ * The "TestMsoController" class is primarily designed to help test "msoCommitController.js"
+ *
+ * This class expects and receives JSON data in the same format as expected
+ * in the "real" application version of this code. However, string versions of JSON are
+ * maintained internally here instead of marshalled / unmarshalled JSON objects.
+ * The primary reasons for this were to encapsulate all the test code in this single file and
+ * minimize the time required to support initial test cases.
+ *
+ * The non-test equivalent of this controller could alternatively incorporate POJO objects
+ * instead of strings. However, the same data format sent to / received from the browser
+ * JavaScript code would still be expected.
+ *
+ * Two specific mechanisms used in this test class may be useful to the application version:
+ *
+ * 1) The use of "{variable}" elements in @RequestMappings along with the corresponding
+ * @PathVariable declarations.
+ *
+ * 2) The use of @ExceptionHandler for general purpose exception handler.
+ * (See @ExceptionHandler comments)
+ *
+ * This class is intended to be used in either:
+ *
+ * A) Eclipse environments
+ * OR
+ * B) Linux environments with ONLY a single user running tests.
+ * The "quick and dirty" error simulation approach used here makes use of static states for some
+ * scenarios. Thus multiple users simultaneously testing in Linux environments
+ * may have contention issues.
+ */
+
+/**
+ * The Class TestMsoController.
+ */
+@RestController
+@RequestMapping("testmso")
+public class TestMsoController extends RestrictedBaseController {
+
+ /*
+ * Artificial delay (in milliseconds) added before responding to create /
+ * delete requests
+ */
+
+ /** The Constant TEST_DELAY_SHORT_MSEC. */
+ private final static int TEST_DELAY_SHORT_MSEC = 1000;
+
+ /*
+ * Long delay to simulate non-responsive server test
+ */
+
+ /** The Constant TEST_DELAY_LONG_MSEC. */
+ private final static int TEST_DELAY_LONG_MSEC = 15000;
+
+ /*
+ * Default number of polls expected before transaction complete.
+ */
+
+ /** The Constant MAXIMUM_POLLS_DEFAULT. */
+ private final static int MAXIMUM_POLLS_DEFAULT = 4;
+
+ /*
+ * Number of polls to simulate "maximum polls exceeded" test.
+ */
+
+ /** The Constant MAXIMUM_POLLS_LARGE. */
+ private final static int MAXIMUM_POLLS_LARGE = 10;
+
+ /*
+ * Simulated error types. The GUI front end is expected to set these values
+ * in the "modelName" field of the "mso_create_svc_instance" request.
+ */
+
+ /** The Constant ERROR_POLICY_EXCEPTION. */
+ private final static String ERROR_POLICY_EXCEPTION = "ERROR_POLICY_EXCEPTION";
+
+ /** The Constant ERROR_SERVICE_EXCEPTION. */
+ private final static String ERROR_SERVICE_EXCEPTION = "ERROR_SERVICE_EXCEPTION";
+
+ /** The Constant ERROR_POLL_FAILURE. */
+ private final static String ERROR_POLL_FAILURE = "ERROR_POLL_FAILURE";
+
+ /** The Constant ERROR_INVALID_FIELD_INITIAL. */
+ private final static String ERROR_INVALID_FIELD_INITIAL = "ERROR_INVALID_FIELD_INITIAL";
+
+ /** The Constant ERROR_INVALID_FIELD_POLL. */
+ private final static String ERROR_INVALID_FIELD_POLL = "ERROR_INVALID_FIELD_POLL";
+
+ /** The Constant ERROR_GENERAL_SERVER_EXCEPTION. */
+ private final static String ERROR_GENERAL_SERVER_EXCEPTION = "ERROR_GENERAL_SERVER_EXCEPTION";
+
+ /** The Constant ERROR_MAX_POLLS. */
+ private final static String ERROR_MAX_POLLS = "ERROR_MAX_POLLS";
+
+ /** The Constant ERROR_SERVER_TIMEOUT_INITIAL. */
+ private final static String ERROR_SERVER_TIMEOUT_INITIAL = "ERROR_SERVER_TIMEOUT_INITIAL";
+
+ /** The Constant ERROR_SERVER_TIMEOUT_POLL. */
+ private final static String ERROR_SERVER_TIMEOUT_POLL = "ERROR_SERVER_TIMEOUT_POLL";
+
+ /** The simulated error. */
+ private String simulatedError = "";
+
+ /** The maximum polls. */
+ private int maximumPolls = 0;
+
+ /** The attempt count. */
+ private int attemptCount = 0;
+
+ /**
+ * Creates the svc instance.
+ *
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_svc_instance", method = RequestMethod.POST)
+ public ResponseEntity<String> createSvcInstance(HttpServletRequest request) throws Exception {
+ readAndLogRequest("CREATE SERVICE INSTANCE", request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+
+ /*
+ * This block of code simulates various errors and would NOT be expected
+ * in a non-test method
+ */
+ System.err.println("simulatedError: " + simulatedError);
+
+ if (simulatedError.equals(ERROR_POLICY_EXCEPTION)) {
+ return new ResponseEntity<String>(policyExceptionResponse, HttpStatus.OK);
+ }
+ if (simulatedError.equals(ERROR_SERVICE_EXCEPTION)) {
+ return new ResponseEntity<String>(serviceExceptionResponse, HttpStatus.OK);
+ }
+ if (simulatedError.equals(ERROR_INVALID_FIELD_INITIAL)) {
+ /*
+ * Force invalid response field name. Return
+ * "XXXXXrequestReferences" instead of "requestReferences"
+ */
+ return new ResponseEntity<String>(acceptResponse.replace("requestReferences", "XXXXXrequestReferences"),
+ HttpStatus.OK);
+ }
+
+ if (simulatedError.equals(ERROR_GENERAL_SERVER_EXCEPTION)) {
+ throw new IOException("an example of an IO exception");
+ }
+
+ if (simulatedError.equals(ERROR_SERVER_TIMEOUT_INITIAL)) {
+ Thread.sleep(TEST_DELAY_LONG_MSEC);
+ }
+
+ if (simulatedError.equals(ERROR_MAX_POLLS)) {
+ maximumPolls = MAXIMUM_POLLS_LARGE;
+ }
+
+ /*
+ * End of block of simulated error code.
+ */
+
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Delete svc instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_svc_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteSvcInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ HttpServletRequest request) throws Exception {
+ readAndLogRequest("DELETE SERVICE INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Creates the vnf instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_vnf_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ HttpServletRequest request) throws Exception {
+ readAndLogRequest("CREATE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Delete vnf instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_vnf_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteVnfInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
+ readAndLogRequest(
+ "DELETE VNF INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: " + vnfInstanceId,
+ request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Creates the vf module instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules
+ @RequestMapping(value = "/mso_create_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
+ readAndLogRequest("CREATE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+ + vnfInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Delete vf module instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param vfModuleInstanceId the vf module instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/vnfs/ff305d54-75b4-ff1b-adb2-eb6b9e5460ff/vfModules/ff305d54-75b4-ff1b-bdb2-eb6b9e5460ff
+ @RequestMapping(value = "/mso_delete_vfmodule_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfModuleInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteVfModuleInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("vnfInstanceId") String vnfInstanceId,
+ @PathVariable("vfModuleInstanceId") String vfModuleInstanceId, HttpServletRequest request)
+ throws Exception {
+ readAndLogRequest("DELETE VF MODULE INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+ + vnfInstanceId + " vfModuleInstanceId: " + vfModuleInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ // POST
+ /**
+ * Creates the volume group instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups
+ @RequestMapping(value = "/mso_create_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("vnfInstanceId") String vnfInstanceId, HttpServletRequest request) throws Exception {
+ readAndLogRequest("CREATE VOLUME GROUP INSTANCE: seviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+ + vnfInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Delete volume group instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param vnfInstanceId the vnf instance id
+ * @param volumeGroupInstanceId the volume group instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ // /serviceInstances/v2/ff305d54-75b4-431b-adb2-eb6b9e5ff000/volumeGroups/ff305d54-75b4-ff1b-cdb2-eb6b9e5460ff
+ @RequestMapping(value = "/mso_delete_volumegroup_instance/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volumeGroupInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteVolumeGroupInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("vnfInstanceId") String vnfInstanceId,
+ @PathVariable("volumeGroupInstanceId") String volumeGroupInstanceId, HttpServletRequest request)
+ throws Exception {
+ readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " vnfInstanceId: "
+ + vnfInstanceId + " volumeGroupInstanceId: " + volumeGroupInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Creates the nw instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_create_nw_instance/{serviceInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> createNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ HttpServletRequest request) throws Exception {
+ readAndLogRequest("CREATE NW INSTANCE: serviceInstanceId: " + serviceInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Delete nw instance.
+ *
+ * @param serviceInstanceId the service instance id
+ * @param networkInstanceId the network instance id
+ * @param request the request
+ * @return the response entity
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_delete_nw_instance/{serviceInstanceId}/networks/{networkInstanceId}", method = RequestMethod.POST)
+ public ResponseEntity<String> deleteNwInstance(@PathVariable("serviceInstanceId") String serviceInstanceId,
+ @PathVariable("networkInstanceId") String networkInstanceId, HttpServletRequest request) throws Exception {
+ readAndLogRequest("DELETE NW INSTANCE: serviceInstanceId: " + serviceInstanceId + " networkInstanceId: "
+ + networkInstanceId, request);
+ Thread.sleep(TEST_DELAY_SHORT_MSEC);
+ maximumPolls = MAXIMUM_POLLS_DEFAULT; // Simulates MSO polling behavior
+ attemptCount = 0;
+ return new ResponseEntity<String>(acceptResponse, HttpStatus.OK);
+ }
+
+ /**
+ * Gets the orchestration request.
+ *
+ * @param requestId the request id
+ * @param request the request
+ * @return the orchestration request
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_get_orch_req/{requestId}", method = RequestMethod.GET)
+ public ResponseEntity<String> getOrchestrationRequest(@PathVariable("requestId") String requestId,
+ HttpServletRequest request) throws Exception {
+
+ System.err.println("GET ORCHESTRATION REQUEST: requestId: " + requestId);
+
+ /*
+ * This block of code simulates various errors and would NOT be expected
+ * in a non-test method
+ */
+
+ if (simulatedError.equals(ERROR_INVALID_FIELD_POLL)) {
+ /*
+ * Force invalid response field name. Return "XXXXXrequestStatus"
+ * instead of "requestStatus"
+ */
+ return new ResponseEntity<String>(inProgressResponse.replace("requestStatus", "XXXXXrequestStatus"),
+ HttpStatus.OK);
+ }
+
+ if (simulatedError.equals(ERROR_POLL_FAILURE)) {
+ /*
+ * Force status field with "Failure"
+ */
+ return new ResponseEntity<String>(inProgressResponse.replace("InProgress", "Failure"), HttpStatus.OK);
+ }
+
+ if (simulatedError.equals(ERROR_SERVER_TIMEOUT_POLL)) {
+ Thread.sleep(TEST_DELAY_LONG_MSEC);
+ }
+
+ /*
+ * End of block of simulated error code.
+ */
+
+ /*
+ * This logic simulates how MSO might behave ... i.e. return different
+ * results depending on the value of 'maximumPolls'.
+ *
+ */
+ int percentProgress = (++attemptCount * 100) / maximumPolls;
+
+ System.err.println("attempts: " + attemptCount + " max: " + maximumPolls + " percent: " + percentProgress);
+
+ String response = inProgressResponse.replace("\"50\"", "\"" + Integer.toString(percentProgress) + "\"");
+
+ if (attemptCount < maximumPolls) {
+ if (attemptCount > 1) {
+ response = response.replace("vLan setup", "setup step " + Integer.toString(attemptCount));
+ }
+ return new ResponseEntity<String>(response, HttpStatus.OK);
+ } else {
+ return new ResponseEntity<String>(
+ response.replace("InProgress", "Complete").replace("vLan setup complete", ""), HttpStatus.OK);
+ }
+ }
+
+ /**
+ * Gets the orchestration requests.
+ *
+ * @param filterString the filter string
+ * @param request the request
+ * @return the orchestration requests
+ * @throws Exception the exception
+ */
+ @RequestMapping(value = "/mso_get_orch_reqs/{filterString}", method = RequestMethod.GET)
+ public ResponseEntity<String> getOrchestrationRequests(@PathVariable("filterString") String filterString,
+ HttpServletRequest request) throws Exception {
+
+ System.err.println("GET ORCHESTRATION REQUESTS: filterString: " + filterString);
+
+ return new ResponseEntity<String>(getOrchestrationRequestsResponse, HttpStatus.OK);
+
+ }
+
+ /*
+ * General purpose exception handler that could be used in application code.
+ *
+ * The method returns exceptions as error code 500. Both the exception type
+ * and message are written as a JSON object.
+ *
+ * See the following references:
+ *
+ * 1) The ExceptionResponse POJO.
+ *
+ * 2) The "getHttpErrorMessage" function in "utilityService.js" - an example
+ * of how the browser JavaScript code can interpret this response.
+ */
+
+ /**
+ * Exception.
+ *
+ * @param e the e
+ * @param response the response
+ * @throws IOException Signals that an I/O exception has occurred.
+ */
+ @ExceptionHandler(Exception.class)
+ private void exception(Exception e, HttpServletResponse response) throws IOException {
+
+ /*
+ * This logging step should preferably be replaced with an appropriate
+ * logging method consistent whatever logging mechanism the rest of the
+ * application code uses.
+ */
+
+ e.printStackTrace(System.err);
+
+ response.setContentType("application/json; charset=UTF-8");
+ response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+
+ ExceptionResponse exceptionResponse = new ExceptionResponse();
+ exceptionResponse.setException(e.getClass().toString().replaceFirst("^.*\\.", ""));
+ exceptionResponse.setMessage(e.getMessage());
+
+ response.getWriter().write(new ObjectMapper().writeValueAsString(exceptionResponse));
+
+ response.flushBuffer();
+
+ }
+
+ /*
+ * 'readAndLogRequest' only intended to be used for testing.
+ *
+ * The method reads JSON from the input stream and thus prevents other
+ * mechanisms from reading the input.
+ */
+
+ /**
+ * Read and log request.
+ *
+ * @param label the label
+ * @param request the request
+ * @throws Exception the exception
+ */
+ private void readAndLogRequest(String label, HttpServletRequest request) throws Exception {
+ String input = request.getReader().lines().collect(Collectors.joining(System.lineSeparator()));
+
+ ObjectMapper mapper = new ObjectMapper();
+ Object json = mapper.readValue(input, Object.class);
+
+ System.err.println(label + "\n" + mapper.writerWithDefaultPrettyPrinter().writeValueAsString(json));
+
+ /*
+ * Only needed for error simulation ...
+ */
+ if (input.matches("^.*modelName.*$")) {
+ simulatedError = input.replaceAll("^.*\"modelName\":\"", "").replaceAll("\".*$", "");
+ }
+ }
+
+ /*
+ * Various test responses:
+ */
+
+ // @formatter:off
+
+ /** The accept response. */
+ /*
+ * Sample responses to initial create / delete transaction
+ */
+ private String acceptResponse =
+ "{" +
+ " \"status\": 202," +
+ " \"entity\": {" +
+ " \"requestReferences\": {" +
+ " \"instanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"," +
+ " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e331\"" +
+ " }" +
+ " }" +
+ "}";
+
+ /** The policy exception response. */
+ private String policyExceptionResponse =
+ "{" +
+ " \"status\": 400," +
+ " \"entity\": { " +
+ " \"requestError\": {" +
+ " \"policyException\": {" +
+ " \"messageId\": \"POL9003\"," +
+ " \"text\": \"Message content size exceeds the allowable limit\"" +
+ " }" +
+ " }" +
+ " }" +
+ "}";
+
+ /** The service exception response. */
+ private String serviceExceptionResponse =
+ "{" +
+ " \"status\": 400," +
+ " \"entity\": { " +
+ " \"requestError\": {" +
+ " \"serviceException\": {" +
+ " \"messageId\": \"SVC2000\"," +
+ " \"text\": \"Missing Parameter: %1. Error code is %2\"," +
+ " \"variables\": [" +
+ " \"severity\"," +
+ " \"400\"" +
+ " ]" +
+ " }" +
+ " }" +
+ " }" +
+ "}" +
+ "";
+
+ /** The in progress response. */
+ /*
+ * Sample response to subsequent getOrchestrationRequest
+ */
+ private String inProgressResponse =
+ "{" +
+ " \"status\": 200," +
+ " \"entity\": {" +
+ " \"request\": {" +
+ " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
+ " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
+ " \"instanceIds\": {" +
+ " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
+ " }," +
+ " \"requestScope\": \"service\"," +
+ " \"requestType\": \"createInstance\"," +
+ " \"requestDetails\": {" +
+ " \"modelInfo\": {" +
+ " \"modelType\": \"service\"," +
+ " \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
+ " \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
+ " \"modelName\": \"WanBonding\"," +
+ " \"modelVersion\": \"1\"" +
+ " }," +
+ " \"subscriberInfo\": {" +
+ " \"globalSubscriberId\": \"C12345\"," +
+ " \"subscriberName\": \"General Electric Division 12\"" +
+ " }," +
+ " \"requestParameters\": {" +
+ " \"vpnId\": \"1a2b3c4d5e6f\"," +
+ " \"productName\": \"Trinity\"," +
+ " \"customerId\": \"icore9883749\"" +
+ " }" +
+ " }," +
+ " \"requestStatus\": {" +
+ " \"timestamp\": \"Thu, 04 Jun 2009 02:53:39 GMT\"," +
+ " \"requestState\": \"InProgress\"," +
+ " \"statusMessage\": \"vLan setup complete\"," +
+ " \"percentProgress\": \"50\"" +
+ " }" +
+ " }" +
+ " }" +
+ "}";
+
+ /*
+ * Sample response to subsequent getOrchestrationRequests
+ */
+
+ /** The get orchestration requests response. */
+ private String getOrchestrationRequestsResponse =
+ "{" +
+ " \"status\": 200," +
+ " \"entity\": {" +
+ " \"requestList\": [" +
+ " {" +
+ " \"request\": {" +
+ " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e333\"," +
+ " \"startTime\": \"Thu, 04 Jun 2009 02:51:59 GMT\"," +
+ " \"finishTime\": \"Thu, 04 Jun 2009 02:55:59 GMT\"," +
+ " \"instanceReferences\": {" +
+ " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
+ " }," +
+ " \"requestScope\": \"service\"," +
+ " \"requestType\": \"createInstance\"," +
+ " \"requestDetails\": {" +
+ " \"modelInfo\": {" +
+ " \"modelType\": \"service\"," +
+ " \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
+ " \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
+ " \"modelName\": \"WanBonding\"," +
+ " \"modelVersion\": \"1\"" +
+ " }," +
+ " \"subscriberInfo\": {" +
+ " \"globalSubscriberId\": \"C12345\"," +
+ " \"subscriberName\": \"General Electric Division 12\"" +
+ " }," +
+ " \"requestParameters\": {" +
+ " \"vpnId\": \"1a2b3c4d5e6f\"," +
+ " \"productName\": \"Trinity\"," +
+ " \"customerId\": \"icore9883749\"" +
+ " }" +
+ " }," +
+ " \"requestStatus\": {" +
+ " \"timestamp\": \"Thu, 04 Jun 2009 02:54:49 GMT\"," +
+ " \"requestState\": \"complete\"," +
+ " \"statusMessage\": \"Resource Created\"," +
+ " \"percentProgress\": \"100\"" +
+ " }" +
+ " }" +
+ " }," +
+ " {" +
+ " \"request\": {" +
+ " \"requestId\": \"rq1234d1-5a33-55df-13ab-12abad84e334\"," +
+ " \"startTime\": \"Thu, 04 Jun 2009 03:52:59 GMT\"," +
+ " \"instanceReferences\": {" +
+ " \"serviceInstanceId\": \"bc305d54-75b4-431b-adb2-eb6b9e546014\"" +
+ " }," +
+ " \"requestScope\": \"service\"," +
+ " \"requestType\": \"updateInstance\"," +
+ " \"requestDetails\": {" +
+ " \"modelInfo\": {" +
+ " \"modelType\": \"service\"," +
+ " \"modelId\": \"sn5256d1-5a33-55df-13ab-12abad84e764\"," +
+ " \"modelNameVersionId\": \"ab6478e4-ea33-3346-ac12-ab121484a333\"," +
+ " \"modelName\": \"WanBonding\"," +
+ " \"modelVersion\": \"1\"" +
+ " }," +
+ " \"subscriberInfo\": {" +
+ " \"globalSubscriberId\": \"C12345\"," +
+ " \"subscriberName\": \"General Electric Division 12\"" +
+ " }," +
+ " \"requestParameters\": {" +
+ " \"vpnId\": \"1a2b3c4d5e70\"," +
+ " \"productName\": \"Trinity\"," +
+ " \"customerId\": \"icore9883749\"" +
+ " }" +
+ " }," +
+ " \"requestStatus\": {" +
+ " \"timestamp\": \"Thu, 04 Jun 2009 03:53:39 GMT\"," +
+ " \"requestState\": \"InProgress\"," +
+ " \"statusMessage\": \"vLan setup complete\"," +
+ " \"percentProgress\": \"50\"" +
+ " }" +
+ " }" +
+ " }" +
+ " ]" +
+ " }" +
+ "}";
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
index 92f86f0bd..48ccdf8d8 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/test/TestPageController.java
+++ b/vid-app-common/src/main/java/org/onap/vid/controller/test/TestPageController.java
@@ -1,57 +1,55 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller.test;
-
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-/**
- * The Class TestPageController.
- */
-@Controller
-public class TestPageController extends RestrictedBaseController {
-
- /**
- * Test mso page.
- *
- * @return the model and view
- */
- @RequestMapping(value = { "testMso.htm" }, method = RequestMethod.GET)
- public ModelAndView testMsoPage() {
- return new ModelAndView(getViewName());
- }
-
- /**
- * Test view edit page.
- *
- * @return the model and view
- */
- @RequestMapping(value = { "testViewEdit" }, method = RequestMethod.GET)
- public ModelAndView testViewEditPage() {
- return new ModelAndView(getViewName());
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.controller.test;
+
+import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.servlet.ModelAndView;
+
+/**
+ * The Class TestPageController.
+ */
+@Controller
+public class TestPageController extends RestrictedBaseController {
+
+ /**
+ * Test mso page.
+ *
+ * @return the model and view
+ */
+ @RequestMapping(value = { "testMso.htm" }, method = RequestMethod.GET)
+ public ModelAndView testMsoPage() {
+ return new ModelAndView(getViewName());
+ }
+
+ /**
+ * Test view edit page.
+ *
+ * @return the model and view
+ */
+ @RequestMapping(value = { "testViewEdit" }, method = RequestMethod.GET)
+ public ModelAndView testViewEditPage() {
+ return new ModelAndView(getViewName());
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
index 6d2810aa0..c27d17e1e 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/dao/FnAppDoaImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/dao/FnAppDoaImpl.java
@@ -1,112 +1,112 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.dao;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URI;
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.Properties;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-
-public class FnAppDoaImpl {
-
- /** The logger. */
- static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FnAppDoaImpl.class);
-
- public int getProfileCount(String driver, String URL, String username, String password) {
- Connection dbc = null;
- PreparedStatement pst = null;
- ResultSet rs = null;
- String q = null;
- int count = 0;
- try {
- dbc = getConnection(driver,URL,username,password);
- logger.debug(EELFLoggerDelegate.debugLogger, "getConnection:::"+ dbc);
- q = "select count(*) from fn_app";
- pst = dbc.prepareStatement(q);
- rs = pst.executeQuery();
-
- if (rs.next())
- count = rs.getInt(1);
- } catch(Exception ex) {
- logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
- } finally {
- cleanup(rs,pst,dbc);
- }
- logger.debug(EELFLoggerDelegate.debugLogger, "count:::"+ count);
- return count;
- }
-
- public static Connection getConnection(String driver2, String url, String username, String password) throws IOException, SQLException, ClassNotFoundException{
- java.sql.Connection con=null;
-
- if( url!=null && username!=null && password!=null ){
- con = DriverManager.getConnection(url, username, password);
- }
-
- System.out.println("Connection Successful");
- return con;
-
- }
-
- public static void cleanup(ResultSet rs, PreparedStatement st, Connection c) {
- if (rs != null) {
- try {
- rs.close();
- } catch (Exception e) {
- if (logger != null)
- logger.error("Error when trying to close result set", e);
- }
- }
- if (st != null) {
- try {
- st.close();
- } catch (Exception e) {
- if (logger != null)
- logger.error("Error when trying to close statement", e);
- }
- }
- if (c != null) {
- try {
- c.rollback();
- } catch (Exception e) {
- if (logger != null)
- logger.error("Error when trying to rollback connection", e);
- }
- try {
- c.close();
- } catch (Exception e) {
- if (logger != null)
- logger.error("Error when trying to close connection", e);
- }
- }
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.dao;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URI;
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.Properties;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+
+public class FnAppDoaImpl {
+
+ /** The logger. */
+ static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(FnAppDoaImpl.class);
+
+ public int getProfileCount(String driver, String URL, String username, String password) {
+ Connection dbc = null;
+ PreparedStatement pst = null;
+ ResultSet rs = null;
+ String q = null;
+ int count = 0;
+ try {
+ dbc = getConnection(driver,URL,username,password);
+ logger.debug(EELFLoggerDelegate.debugLogger, "getConnection:::"+ dbc);
+ q = "select count(*) from fn_app";
+ pst = dbc.prepareStatement(q);
+ rs = pst.executeQuery();
+
+ if (rs.next())
+ count = rs.getInt(1);
+ } catch(Exception ex) {
+ logger.error(EELFLoggerDelegate.errorLogger, "Failed to perform health check", ex);
+ } finally {
+ cleanup(rs,pst,dbc);
+ }
+ logger.debug(EELFLoggerDelegate.debugLogger, "count:::"+ count);
+ return count;
+ }
+
+ public static Connection getConnection(String driver2, String url, String username, String password) throws IOException, SQLException, ClassNotFoundException{
+ java.sql.Connection con=null;
+
+ if( url!=null && username!=null && password!=null ){
+ con = DriverManager.getConnection(url, username, password);
+ }
+
+ System.out.println("Connection Successful");
+ return con;
+
+ }
+
+ public static void cleanup(ResultSet rs, PreparedStatement st, Connection c) {
+ if (rs != null) {
+ try {
+ rs.close();
+ } catch (Exception e) {
+ if (logger != null)
+ logger.error("Error when trying to close result set", e);
+ }
+ }
+ if (st != null) {
+ try {
+ st.close();
+ } catch (Exception e) {
+ if (logger != null)
+ logger.error("Error when trying to close statement", e);
+ }
+ }
+ if (c != null) {
+ try {
+ c.rollback();
+ } catch (Exception e) {
+ if (logger != null)
+ logger.error("Error when trying to rollback connection", e);
+ }
+ try {
+ c.close();
+ } catch (Exception e) {
+ if (logger != null)
+ logger.error("Error when trying to close connection", e);
+ }
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java b/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
index 256a4bd8d..e6a8a4e54 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/dao/ProfileDao.java
+++ b/vid-app-common/src/main/java/org/onap/vid/dao/ProfileDao.java
@@ -1,45 +1,45 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.dao;
-
-import java.util.List;
-import org.openecomp.portalsdk.core.domain.Profile;
-
-/**
- * The Interface ProfileDao.
- */
-public interface ProfileDao {
-
- /**
- * Find all.
- *
- * @return the list
- */
- List<Profile> findAll();
-
- /**
- * Gets the profile.
- *
- * @param id the id
- * @return the profile
- */
- Profile getProfile(int id);
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.dao;
+
+import java.util.List;
+import org.openecomp.portalsdk.core.domain.Profile;
+
+/**
+ * The Interface ProfileDao.
+ */
+public interface ProfileDao {
+
+ /**
+ * Find all.
+ *
+ * @return the list
+ */
+ List<Profile> findAll();
+
+ /**
+ * Gets the profile.
+ *
+ * @param id the id
+ * @return the profile
+ */
+ Profile getProfile(int id);
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java b/vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java
new file mode 100644
index 000000000..0616aa1f1
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/exceptions/NotFoundException.java
@@ -0,0 +1,12 @@
+package org.onap.vid.exceptions;
+
+public class NotFoundException extends RuntimeException {
+
+ public NotFoundException(String message) {
+ super(message);
+ }
+
+ public NotFoundException(String message, Throwable cause) {
+ super(message, cause);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java b/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
index fcd897f78..622b34c22 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/exceptions/VidServiceUnavailableException.java
+++ b/vid-app-common/src/main/java/org/onap/vid/exceptions/VidServiceUnavailableException.java
@@ -1,69 +1,69 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.exceptions;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.web.bind.annotation.ResponseStatus;
-
-/**
- * The Class VidServiceUnavailableException.
- */
-@ResponseStatus(value=HttpStatus.SERVICE_UNAVAILABLE)
-public class VidServiceUnavailableException extends Exception {
-
- /** The Constant serialVersionUID. */
- private static final long serialVersionUID = 1L;
-
- /**
- * Instantiates a new vid service unavailable exception.
- */
- public VidServiceUnavailableException() {
- super();
- }
-
- /**
- * Instantiates a new vid service unavailable exception.
- *
- * @param msg the msg
- */
- public VidServiceUnavailableException(String msg) {
- super(msg);
- }
-
- /**
- * Instantiates a new vid service unavailable exception.
- *
- * @param t the t
- */
- public VidServiceUnavailableException(Throwable t) {
- super(t);
- }
-
- /**
- * Instantiates a new vid service unavailable exception.
- *
- * @param msg the msg
- * @param t the t
- */
- public VidServiceUnavailableException(String msg, Throwable t) {
- super(msg, t);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.exceptions;
+
+import org.springframework.http.HttpStatus;
+import org.springframework.web.bind.annotation.ResponseStatus;
+
+/**
+ * The Class VidServiceUnavailableException.
+ */
+@ResponseStatus(value=HttpStatus.SERVICE_UNAVAILABLE)
+public class VidServiceUnavailableException extends Exception {
+
+ /** The Constant serialVersionUID. */
+ private static final long serialVersionUID = 1L;
+
+ /**
+ * Instantiates a new vid service unavailable exception.
+ */
+ public VidServiceUnavailableException() {
+ super();
+ }
+
+ /**
+ * Instantiates a new vid service unavailable exception.
+ *
+ * @param msg the msg
+ */
+ public VidServiceUnavailableException(String msg) {
+ super(msg);
+ }
+
+ /**
+ * Instantiates a new vid service unavailable exception.
+ *
+ * @param t the t
+ */
+ public VidServiceUnavailableException(Throwable t) {
+ super(t);
+ }
+
+ /**
+ * Instantiates a new vid service unavailable exception.
+ *
+ * @param msg the msg
+ * @param t the t
+ */
+ public VidServiceUnavailableException(String msg, Throwable t) {
+ super(msg, t);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java b/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
index 9cc9c5f66..22bfa47bc 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/factories/MsoRequestFactory.java
+++ b/vid-app-common/src/main/java/org/onap/vid/factories/MsoRequestFactory.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.factories;
+package org.onap.vid.factories;
-import org.openecomp.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
/**
* Created by pickjonathan on 19/06/2017.
diff --git a/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java b/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
new file mode 100644
index 000000000..e4e0edb8c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/logging/VidLoggerAspect.java
@@ -0,0 +1,85 @@
+package org.onap.vid.logging;
+
+import org.apache.commons.lang3.StringUtils;
+import org.aspectj.lang.ProceedingJoinPoint;
+import org.aspectj.lang.annotation.Around;
+import org.aspectj.lang.annotation.Aspect;
+import org.aspectj.lang.annotation.Pointcut;
+import org.openecomp.portalsdk.core.logging.aspect.EELFLoggerAdvice;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import java.net.InetAddress;
+import java.net.UnknownHostException;
+
+import static com.att.eelf.configuration.Configuration.MDC_SERVER_FQDN;
+
+
+@Aspect
+@org.springframework.context.annotation.Configuration
+public class VidLoggerAspect {
+
+ private String canonicalHostName;
+ @Autowired
+ EELFLoggerAdvice advice;
+
+ public VidLoggerAspect() {
+ try {
+ final InetAddress localHost = InetAddress.getLocalHost();
+ canonicalHostName = localHost.getCanonicalHostName();
+ } catch (UnknownHostException e) {
+ // YOLO
+ canonicalHostName = null;
+ }
+ }
+
+ @Pointcut("execution(public * org.onap.vid.controller.*Controller.*(..))")
+ public void vidControllers() {}
+
+ @Around("vidControllers() && (" +
+ " @within(org.openecomp.portalsdk.core.logging.aspect.AuditLog)" +
+ " || @annotation(org.openecomp.portalsdk.core.logging.aspect.AuditLog)" +
+ " || @annotation(org.springframework.web.bind.annotation.RequestMapping)" +
+ ")")
+ public Object logAuditMethodClassAround(ProceedingJoinPoint joinPoint) throws Throwable {
+ return logAroundMethod(joinPoint, SystemProperties.SecurityEventTypeEnum.INCOMING_REST_MESSAGE);
+ }
+
+ private Object logAroundMethod(ProceedingJoinPoint joinPoint, SystemProperties.SecurityEventTypeEnum securityEventType) throws Throwable {
+ //Before
+ Object[] passOnArgs = new Object[] {joinPoint.getSignature().getDeclaringType().getName(),joinPoint.getSignature().getName()};
+ Object[] returnArgs = advice.before(securityEventType, joinPoint.getArgs(), passOnArgs);
+
+ fixServerFqdnInMDC();
+
+ //Execute the actual method
+ Object result;
+ String restStatus = "COMPLETE";
+ try {
+ result = joinPoint.proceed();
+ } catch(Exception e) {
+ restStatus = "ERROR";
+ throw e;
+ } finally {
+ fixStatusCodeInMDC(restStatus);
+ advice.after(securityEventType, restStatus, joinPoint.getArgs(), returnArgs, passOnArgs);
+ }
+
+ return result;
+ }
+
+ // Set the status code into MDC *before* the metrics log is written by advice.after()
+ private void fixStatusCodeInMDC(String restStatus) {
+ EELFLoggerDelegate.mdcPut(SystemProperties.STATUS_CODE, restStatus);
+ }
+
+ // Override the non-canonical hostname set by EELFLoggerDelegate::setGlobalLoggingContext()
+ // that was invoked by advice.before() (and some other SDK cases)
+ private void fixServerFqdnInMDC() {
+ if (!StringUtils.isBlank(canonicalHostName)) {
+ EELFLoggerDelegate.mdcPut(MDC_SERVER_FQDN, canonicalHostName);
+ }
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
new file mode 100644
index 000000000..e2939996f
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameter.java
@@ -0,0 +1,120 @@
+package org.onap.vid.model;
+
+//import org.hibernate.annotations.Table;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+import org.onap.vid.controller.MaintenanceController;
+
+//import javax.persistence.*;
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_category_parameter", uniqueConstraints = @UniqueConstraint(columnNames = "name"))
+public class CategoryParameter extends DomainVo {
+
+ public enum Family {
+ PARAMETER_STANDARDIZATION,
+ TENANT_ISOLATION
+ }
+
+ private String name;
+ private boolean idSupported;
+
+ @Column(name = "FAMILY")
+ @Enumerated(EnumType.STRING)
+ private String family;
+
+ public String getFamily() {
+ return family;
+ }
+
+ public void setFamily(String family) {
+ this.family = family;
+ }
+
+ private Set<CategoryParameterOption> options = new HashSet<>(0);
+
+ @Override
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "CATEGORY_ID")
+ public Long getId() {
+ return super.getId();
+ }
+
+ @Override
+ @Column(name = "CREATED_DATE")
+ public Date getCreated() {
+ return super.getCreated();
+ }
+
+ @Override
+ @Column(name = "MODIFIED_DATE")
+ public Date getModified() {
+ return super.getModified();
+ }
+
+ @Override
+ @Transient
+ public Long getCreatedId() {
+ return super.getCreatedId();
+ }
+
+ @Override
+ @Transient
+ public Long getModifiedId() {
+ return super.getModifiedId();
+ }
+
+ @Column(name = "NAME", unique = true, nullable = false, length=50)
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @Override
+ @Transient
+ public Serializable getAuditUserId() {
+ return super.getAuditUserId();
+ }
+
+ @Override
+ @Transient
+ public Long getRowNum() {
+ return super.getRowNum();
+ }
+
+ @Override
+ @Transient
+ public Set getAuditTrail() {
+ return super.getAuditTrail();
+ }
+
+ @OneToMany(fetch = FetchType.EAGER, mappedBy = "categoryParameter")
+ public Set<CategoryParameterOption> getOptions() {
+ return options;
+ }
+
+ public void setOptions(Set<CategoryParameterOption> options) {
+ this.options = options;
+ }
+
+ public boolean addOption(CategoryParameterOption option) {
+ return options.add(option);
+ }
+
+ @Column(name = "ID_SUPPORTED")
+ public boolean isIdSupported() {
+ return idSupported;
+ }
+
+ public void setIdSupported(boolean idSupported) {
+ this.idSupported = idSupported;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
new file mode 100644
index 000000000..39efb2c57
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CategoryParameterOption.java
@@ -0,0 +1,139 @@
+package org.onap.vid.model;
+
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_category_parameter_option")
+public class CategoryParameterOption extends DomainVo {
+
+ private Long id;
+ private String appId;
+ private String name;
+
+ private CategoryParameter categoryParameter;
+
+ public CategoryParameterOption() {
+ }
+
+ public CategoryParameterOption(String appId, String name, CategoryParameter categoryParameter) {
+ setAppId(appId);
+ setName(name);
+ setCategoryParameter(categoryParameter);
+ }
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "CATEGORY_OPT_DB_ID")
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Column(name = "CATEGORY_OPT_APP_ID")
+ public String getAppId() {
+ return appId;
+ }
+
+ public void setAppId(String appId) {
+ this.appId = appId;
+ }
+
+ @Column(name = "NAME")
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ @ManyToOne
+ @JoinColumn(name="CATEGORY_ID", nullable=false)
+ public CategoryParameter getCategoryParameter() {
+ return categoryParameter;
+ }
+
+ public void setCategoryParameter(CategoryParameter categoryParameter) {
+ this.categoryParameter = categoryParameter;
+ }
+
+ @Override
+ @Column(name = "CREATED_DATE")
+ public Date getCreated() {
+ return super.getCreated();
+ }
+
+ @Override
+ @Column(name = "MODIFIED_DATE")
+ public Date getModified() {
+ return super.getModified();
+ }
+
+ @Override
+ @Transient
+ public Long getCreatedId() {
+ return super.getCreatedId();
+ }
+
+ @Override
+ @Transient
+ public Long getModifiedId() {
+ return super.getModifiedId();
+ }
+
+ @Override
+ @Transient
+ public Serializable getAuditUserId() {
+ return super.getAuditUserId();
+ }
+
+ @Override
+ @Transient
+ public Long getRowNum() {
+ return super.getRowNum();
+ }
+
+ @Override
+ @Transient
+ public Set getAuditTrail() {
+ return super.getAuditTrail();
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ CategoryParameterOption that = (CategoryParameterOption) o;
+
+ if (getAppId() != null ? !getAppId().equals(that.getAppId()) : that.getAppId() != null) return false;
+ if (getName() != null ? !getName().equals(that.getName()) : that.getName() != null) return false;
+ return getCategoryParameter() != null ? getCategoryParameter().equals(that.getCategoryParameter()) : that.getCategoryParameter() == null;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = getAppId() != null ? getAppId().hashCode() : 0;
+ result = 31 * result + (getName() != null ? getName().hashCode() : 0);
+ result = 31 * result + (getCategoryParameter() != null ? getCategoryParameter().hashCode() : 0);
+ return result;
+ }
+
+ @Override
+ public String toString() {
+ return "CategoryParameterOption{" +
+ "id=" + id +
+ ", key='" + appId + '\'' +
+ ", value='" + name + '\'' +
+ ", categoryParameterId=" + categoryParameter.getId() +
+ '}';
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java b/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
index 740f9d781..4f5ee173f 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/CommandProperty.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/CommandProperty.java
@@ -1,93 +1,93 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-
-/**
- * The Class Command Property.
- */
-public class CommandProperty {
-
- /** The display name for this input */
- private String displayName;
-
- /** The command, "get_input" */
- private String command;
-
- /** The input name we refer to back under the inputs section */
- private String inputName;
-
- /**
- * Gets the display name.
- *
- * @return the displayName
- */
- public String getDisplayName() {
- return displayName;
- }
- /**
- * Gets the command.
- *
- * @return the command
- */
- public String getCommand() {
- return command;
- }
- /**
- * Gets the inputName.
- *
- * @return the inputName
- */
- public String getInputName() {
- return inputName;
- }
- /**
- * Sets the display name value.
- *
- * @param i the new get_input value
- */
- public void setDisplayName(String i) {
- this.displayName = i;
- }
- /**
- * Sets the command value.
- *
- * @param i the new command value
- */
- public void setCommand(String i) {
- this.command = i;
- }
-
- /**
- * Sets the input name value.
- *
- * @param i the new input name value
- */
- public void setInputName(String i) {
- this.inputName=i;
- }
-
- public String toString () {
- String result = "displayName=" + displayName + " command=" + command + " inputName" + inputName;
- return result;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.util.Map;
+
+/**
+ * The Class Command Property.
+ */
+public class CommandProperty {
+
+ /** The display name for this input */
+ private String displayName;
+
+ /** The command, "get_input" */
+ private String command;
+
+ /** The input name we refer to back under the inputs section */
+ private String inputName;
+
+ /**
+ * Gets the display name.
+ *
+ * @return the displayName
+ */
+ public String getDisplayName() {
+ return displayName;
+ }
+ /**
+ * Gets the command.
+ *
+ * @return the command
+ */
+ public String getCommand() {
+ return command;
+ }
+ /**
+ * Gets the inputName.
+ *
+ * @return the inputName
+ */
+ public String getInputName() {
+ return inputName;
+ }
+ /**
+ * Sets the display name value.
+ *
+ * @param i the new get_input value
+ */
+ public void setDisplayName(String i) {
+ this.displayName = i;
+ }
+ /**
+ * Sets the command value.
+ *
+ * @param i the new command value
+ */
+ public void setCommand(String i) {
+ this.command = i;
+ }
+
+ /**
+ * Sets the input name value.
+ *
+ * @param i the new input name value
+ */
+ public void setInputName(String i) {
+ this.inputName=i;
+ }
+
+ public String toString () {
+ String result = "displayName=" + displayName + " command=" + command + " inputName" + inputName;
+ return result;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
index 686971d76..444a4ba11 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ExceptionResponse.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionResponse.java
@@ -1,70 +1,91 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class ExceptionResponse.
- */
-public class ExceptionResponse {
-
- /** The exception. */
- private String exception;
-
- /** The message. */
- private String message;
-
- /**
- * Gets the exception.
- *
- * @return the exception
- */
- public String getException() {
- return exception;
- }
-
- /**
- * Sets the exception.
- *
- * @param exception the new exception
- */
- public void setException(String exception) {
- this.exception = exception;
- }
-
- /**
- * Gets the message.
- *
- * @return the message
- */
- public String getMessage() {
- return message;
- }
-
- /**
- * Sets the message.
- *
- * @param message the new message
- */
- public void setMessage(String message) {
- this.message = message;
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.slf4j.MDC;
+
+import static com.att.eelf.configuration.Configuration.MDC_KEY_REQUEST_ID;
+
+/**
+ * The Class ExceptionResponse.
+ */
+public class ExceptionResponse {
+
+ public ExceptionResponse() {
+ }
+
+ /** The exception. */
+ private String exception;
+
+ /** The message. */
+ private String message;
+
+ public ExceptionResponse(String exception, String message) {
+ this.exception = exception;
+ this.message = message;
+ }
+
+ public ExceptionResponse(Exception exception) {
+ setException(exception);
+ }
+
+ /**
+ * Gets the exception.
+ *
+ * @return the exception
+ */
+ public String getException() {
+ return exception;
+ }
+
+ /**
+ * Sets the exception.
+ *
+ * @param exception the new exception
+ */
+ public void setException(String exception) {
+ this.exception = exception;
+ }
+
+ public void setException(Exception exception) {
+ setException(exception.getClass().toString().replaceFirst("^.*[\\.$]", ""));
+ setMessage(exception.getMessage() + " (Request id: " + MDC.get(MDC_KEY_REQUEST_ID) + ")");
+ }
+
+ /**
+ * Gets the message.
+ *
+ * @return the message
+ */
+ public String getMessage() {
+ return message;
+ }
+
+ /**
+ * Sets the message.
+ *
+ * @param message the new message
+ */
+ public void setMessage(String message) {
+ this.message = message;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java
new file mode 100644
index 000000000..c600243a8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ExceptionTranslator.java
@@ -0,0 +1,39 @@
+package org.onap.vid.model;
+
+import org.apache.commons.lang.StringUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.springframework.web.bind.annotation.ControllerAdvice;
+import org.springframework.web.bind.annotation.ExceptionHandler;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.method.annotation.MethodArgumentTypeMismatchException;
+
+import static org.onap.vid.utils.Logging.getMethodCallerName;
+
+@ControllerAdvice
+public class ExceptionTranslator {
+
+ /** The logger. */
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ExceptionTranslator.class);
+
+ @ExceptionHandler(MethodArgumentTypeMismatchException.class)
+ @ResponseBody
+ public ExceptionResponse handleMethodArgumentTypeMismatchException(MethodArgumentTypeMismatchException e) {
+ logger.error(EELFLoggerDelegate.errorLogger, "{}: {}", getMethodCallerName(), ExceptionUtils.getMessage(e), e);
+ Class<?> type = e.getRequiredType();
+ String message;
+ if (type.isEnum()) {
+ message = "The parameter " + e.getName() + " must have a value among : " + StringUtils.join(type.getEnumConstants(), ", ");
+ }
+ else {
+ message = "The parameter " + e.getName() + " must be of type " + type.getTypeName();
+ }
+ return new ExceptionResponse(new ArgumentTypeMismatchException(message));
+ }
+
+ public static class ArgumentTypeMismatchException extends RuntimeException {
+ public ArgumentTypeMismatchException(String message) {
+ super(message);
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java
new file mode 100644
index 000000000..9339d7cd8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ListOfErrorsResponse.java
@@ -0,0 +1,24 @@
+package org.onap.vid.model;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ListOfErrorsResponse {
+ protected List<String> errors;
+
+ public ListOfErrorsResponse() {
+ this.errors = new ArrayList<>();
+ }
+
+ public ListOfErrorsResponse(List<String> errors) {
+ this.errors = errors;
+ }
+
+ public List<String> getErrors() {
+ return errors;
+ }
+
+ public void setErrors(List<String> errors) {
+ this.errors = errors;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java b/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
index af5f0db91..cb1a5f9a0 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelConstants.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ModelConstants.java
@@ -1,42 +1,44 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-/**
- * The Class ModelConstants
- */
-public class ModelConstants {
-
- /** The Constant GET_INPUT_TAG. */
- public final static String GET_INPUT_TAG = "get_input";
-
- public static final String ASDC_MODEL_NAMESPACE = "asdc.model.namespace";
- public static final String ASDC_SVC_API_PATH = "sdc.svc.api.path";
- public static final String ASDC_RESOURCE_API_PATH = "sdc.resource.api.path";
-
- public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.openecomp.";
- public static final String DEFAULT_ASDC_SVC_API_PATH = "sdc/v1/catalog/services";
- public static final String DEFAULT_ASDC_RESOURCE_API_PATH = "sdc/v1/catalog/resources";
-
- public final static String VF_MODULE = "groups.VfModule";
- public final static String VNF = "resource.vf";
- public final static String NETWORK = "resource.vl";
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+/**
+ * The Class ModelConstants
+ */
+public class ModelConstants {
+
+ /** The Constant GET_INPUT_TAG. */
+ public final static String GET_INPUT_TAG = "get_input";
+
+ public static final String ASDC_MODEL_NAMESPACE = "asdc.model.namespace";
+ public static final String ASDC_SVC_API_PATH = "sdc.svc.api.path";
+ public static final String ASDC_RESOURCE_API_PATH = "sdc.resource.api.path";
+
+ public static final String DEFAULT_ASDC_MODEL_NAMESPACE = "org.openecomp.";
+ public static final String DEFAULT_ASDC_SVC_API_PATH = "sdc/v1/catalog/services";
+ public static final String DEFAULT_ASDC_RESOURCE_API_PATH = "sdc/v1/catalog/resources";
+
+ public final static String VF_MODULE = "groups.VfModule";
+ public final static String VNF = "resource.vf";
+ public final static String NETWORK = "resource.vl";
+
+ public final static String ROLE_DELIMITER = "___";
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java b/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
index f0208185a..897c6e76c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ModelUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ModelUtil.java
@@ -1,7 +1,7 @@
/**
*
*/
-package org.openecomp.vid.model;
+package org.onap.vid.model;
/**
* The Class ModelUtil.
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java
new file mode 100644
index 000000000..0fe49d604
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/MsoExceptionResponse.java
@@ -0,0 +1,32 @@
+package org.onap.vid.model;
+
+public class MsoExceptionResponse {
+
+ public static class ServiceException {
+
+ public ServiceException(String messageId, String text) {
+ this.messageId = messageId;
+ this.text = text;
+ }
+
+ public ServiceException() {
+ }
+
+ public String messageId;
+ public String text;
+ }
+
+ public ServiceException serviceException;
+
+ public MsoExceptionResponse() {
+ }
+
+ public MsoExceptionResponse(String messageId, String text) {
+ this.serviceException = new ServiceException(messageId, text);
+ }
+
+ public MsoExceptionResponse(Exception exception) {
+ ExceptionResponse exceptionResponse = new ExceptionResponse(exception);
+ this.serviceException = new ServiceException(exceptionResponse.getException(), exceptionResponse.getMessage());
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Network.java b/vid-app-common/src/main/java/org/onap/vid/model/Network.java
index e763496fc..ef342e407 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Network.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Network.java
@@ -1,62 +1,62 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-/**
- * The Class Network.
- */
-public class Network extends Node {
-
- /** The model customization name. */
- private String modelCustomizationName;
-
- /**
- * Instantiates a new network.
- */
- public Network() {
- super();
- }
- /**
- * Gets the model customization name.
- *
- * @return the model customization name
- */
- public String getModelCustomizationName() {
- return modelCustomizationName;
- }
- /**
- * Sets the model customization name.
- *
- * @param modelCustomizationName the new model customization name
- */
- public void setModelCustomizationName(String modelCustomizationName) {
- this.modelCustomizationName = modelCustomizationName;
- }
-
- public void extractNetwork(String modelCustomizationName, NodeTemplate nodeTemplate) {
-
- super.extractNode(nodeTemplate);
- setModelCustomizationName(modelCustomizationName);
-
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+/**
+ * The Class Network.
+ */
+public class Network extends Node {
+
+ /** The model customization name. */
+ private String modelCustomizationName;
+
+ /**
+ * Instantiates a new network.
+ */
+ public Network() {
+ super();
+ }
+ /**
+ * Gets the model customization name.
+ *
+ * @return the model customization name
+ */
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+ /**
+ * Sets the model customization name.
+ *
+ * @param modelCustomizationName the new model customization name
+ */
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+
+ public void extractNetwork(String modelCustomizationName, NodeTemplate nodeTemplate) {
+
+ super.extractNode(nodeTemplate);
+ setModelCustomizationName(modelCustomizationName);
+
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java b/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
index 48e3a55fd..9f1ffd356 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNetwork.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewNetwork.java
@@ -18,9 +18,9 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.model;
+package org.onap.vid.model;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
/**
* The Class Network.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java b/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
index 681131fc9..89a808b19 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewNode.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewNode.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -6,7 +6,7 @@ import java.util.HashMap;
import java.util.Map;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.beans.tosca.Input;
public class NewNode {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
index 1dcf0224e..1346c0d95 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewService.java
@@ -18,12 +18,12 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import java.util.Map;
import java.util.UUID;
-import org.openecomp.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.beans.tosca.Input;
/**
* The Class Service.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
index 6fda979c1..e343b6de0 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewServiceModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewServiceModel.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -26,13 +26,14 @@ import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
-import org.openecomp.vid.asdc.beans.tosca.Group;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.properties.VidProperties;
+import org.onap.vid.properties.VidProperties;
/**
* The Class ServiceModel.
*/
+
public class NewServiceModel {
/** The Constant LOG. */
@@ -59,6 +60,13 @@ public class NewServiceModel {
* for newer models
*/
private Map<String, VolumeGroup> volumeGroups;
+
+ private Map<String, PortMirroringConfig> configurations;
+
+ private Map<String, ServiceProxy> serviceProxies;
+
+ private Map<String, Node> pnfs;
+
/**
* Instantiates a new service model.
*/
@@ -133,11 +141,22 @@ public class NewServiceModel {
public Map<String, VolumeGroup> getVolumeGroups() {
return volumeGroups;
}
+
+ public Map<String, PortMirroringConfig> getConfigurations() {
+ return configurations;
+ }
+
+ public Map<String, ServiceProxy> getServiceProxies() {
+ return serviceProxies;
+ }
+
/**
* Sets the vf modules.
*
* @param vfModules the vf modules
*/
+
+
public void setVfModules(Map<String, VfModule> vfModules) {
this.vfModules = vfModules;
}
@@ -149,6 +168,16 @@ public class NewServiceModel {
public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
this.volumeGroups = volumeGroups;
}
+
+
+ public Map<String, Node> getPnfs() {
+ return pnfs;
+ }
+
+ public void setPnfs(Map<String, Node> pnfs) {
+ this.pnfs = pnfs;
+ }
+
/**
* Extract service.
*
@@ -156,7 +185,7 @@ public class NewServiceModel {
* @param asdcServiceMetadata the asdc service metadata
* @return the service
*/
- public static Service extractService(ToscaModel serviceToscaModel, org.openecomp.vid.asdc.beans.Service asdcServiceMetadata) {
+ public static Service extractService(ToscaModel serviceToscaModel, org.onap.vid.asdc.beans.Service asdcServiceMetadata) {
final Service service = new Service();
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java b/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
index e84f963c5..8e8c89f51 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/NewVNF.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/NewVNF.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -7,7 +7,7 @@ import java.util.Map;
import java.util.regex.Pattern;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
public class NewVNF extends NewNode {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
index 1352653e1..7623a3869 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Node.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Node.java
@@ -1,301 +1,322 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Input;
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-/**
- * The Class Node.
- */
-public class Node {
- /** The Constant LOG. */
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(Node.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant uuid. */
- private String invariantUuid;
-
- /** The description. */
- private String description;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
- /** The model customization uuid. */
- private String customizationUuid;
-
- /** The inputs. */
- private Map<String, Input> inputs;
-
- /** The get_input or other constructs from node template properties. */
- private Map<String, CommandProperty> commands;
-
- /** The get_input or other constructs from node template properties. */
- private Map<String, String> properties;
- /**
- * Instantiates a new node.
- */
- public Node() {
- this.commands = new HashMap<String, CommandProperty>();
- this.properties = new HashMap<String, String>();
- }
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the invariant uuid.
- *
- * @return the invariant uuid
- */
- public String getInvariantUuid() {
- return invariantUuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the customization uuid.
- *
- * @return the model customization uuid
- */
- public String getCustomizationUuid() {
- return customizationUuid;
- }
- /**
- * Gets the inputs.
- *
- * @return the inputs
- */
- public Map<String, Input> getInputs() {
- return inputs;
- }
- /**
- * Gets the commands.
- *
- * @return the commands
- */
- public Map<String, CommandProperty> getCommands() {
- return commands;
- }
- /**
- * Gets the properties.
- *
- * @return the properties
- */
- public Map<String, String> getProperties() {
- return properties;
- }
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant uuid.
- *
- * @param invariantUuid the new invariant uuid
- */
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
- /**
- * Sets the customization uuid.
- *
- * @param u the new customization uuid
- */
- public void setCustomizationUuid(String u) {
- this.customizationUuid = u;
- }
-
- /**
- * Sets the inputs.
- *
- * @param inputs the inputs
- */
- public void setInputs(Map<String, Input> inputs) {
- this.inputs = inputs;
- }
- /**
- * Sets the commands.
- *
- * @param m the commands
- */
- public void setCommands( Map<String, CommandProperty>m ) {
- commands = m;
- }
- /**
- * Sets the properties.
- *
- * @param p the properties
- */
- public void setProperties( Map<String, String>p) {
- properties = p;
- }
- /**
- * Extract node.
- *
- * @param modelCustomizationName the model customization name
- * @param nodeTemplate the node template
- * @return the node
- */
- public void extractNode (NodeTemplate nodeTemplate) {
-
- String methodName = "extractNode";
-
- setUuid(nodeTemplate.getMetadata().getUUID());
- setInvariantUuid(nodeTemplate.getMetadata().getInvariantUUID());
- setDescription(nodeTemplate.getMetadata().getDescription());
- setName(nodeTemplate.getMetadata().getName());
- setVersion(nodeTemplate.getMetadata().getVersion());
- // add customizationUUID
- setCustomizationUuid(nodeTemplate.getMetadata().getCustomizationUUID());
-
- try {
- // nodeTemplate.getProperties() map of String->Object
- for (Entry<String, Object> e : nodeTemplate.getProperties().entrySet()) {
-
- String k = e.getKey();
-
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " node template property: " + k );
-
- if ( e.getValue() != null ) {
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
- k + "=" + e.getValue());
- //LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
- // e.getValue().getClass().getName());
- Class<?> c = e.getValue().getClass();
- if ( c.getName().equalsIgnoreCase(java.lang.String.class.getName())) {
- getProperties().put (k, (String)e.getValue());
- }
- else {
- Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
-
- for(Class<?> ifc: interfaces ) {
- //LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
- // ifc.getName());
- if ( ifc.getName().equalsIgnoreCase(java.util.Map.class.getName()) ) {
- // only extract get_input for now
- @SuppressWarnings("unchecked")
- HashMap<String,String> v = (HashMap<String,String>)e.getValue();
- for (Entry<String, String> entry : v.entrySet()) {
- // only include get_input for now
- if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
- CommandProperty cp = new CommandProperty();
- cp.setCommand(entry.getKey());
- cp.setInputName(entry.getValue());
- cp.setDisplayName(k);
- getCommands().put(k,cp);
- }
- }
- }
- }
-
- }
- }
- }
- }
- catch ( Exception e ) {
- LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse node properties: e=" +
- e.toString());
- }
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.onap.vid.asdc.beans.tosca.Input;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+/**
+ * The Class Node.
+ */
+public class Node {
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(Node.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant uuid. */
+ private String invariantUuid;
+
+ /** The description. */
+ private String description;
+
+ /** The name. */
+ private String name;
+
+ /** The version. */
+ private String version;
+
+ /** The model customization uuid. */
+ private String customizationUuid;
+
+ /** The inputs. */
+ private Map<String, Input> inputs;
+
+ /** The get_input or other constructs from node template properties. */
+ private Map<String, CommandProperty> commands;
+
+ /** The get_input or other constructs from node template properties. */
+ private Map<String, String> properties;
+
+ /** Type from Metadata */
+ private String type;
+ /**
+ * Instantiates a new node.
+ */
+ public Node() {
+ this.commands = new HashMap<String, CommandProperty>();
+ this.properties = new HashMap<String, String>();
+ }
+
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * Gets the invariant uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the customization uuid.
+ *
+ * @return the model customization uuid
+ */
+ public String getCustomizationUuid() {
+ return customizationUuid;
+ }
+ /**
+ * Gets the inputs.
+ *
+ * @return the inputs
+ */
+ public Map<String, Input> getInputs() {
+ return inputs;
+ }
+ /**
+ * Gets the commands.
+ *
+ * @return the commands
+ */
+ public Map<String, CommandProperty> getCommands() {
+ return commands;
+ }
+ /**
+ * Gets the properties.
+ *
+ * @return the properties
+ */
+ public Map<String, String> getProperties() {
+ return properties;
+ }
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant uuid.
+ *
+ * @param invariantUuid the new invariant uuid
+ */
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+ /**
+ * Sets the customization uuid.
+ *
+ * @param u the new customization uuid
+ */
+ public void setCustomizationUuid(String u) {
+ this.customizationUuid = u;
+ }
+
+ /**
+ * Sets the inputs.
+ *
+ * @param inputs the inputs
+ */
+ public void setInputs(Map<String, Input> inputs) {
+ this.inputs = inputs;
+ }
+ /**
+ * Sets the commands.
+ *
+ * @param m the commands
+ */
+ public void setCommands( Map<String, CommandProperty>m ) {
+ commands = m;
+ }
+ /**
+ * Sets the properties.
+ *
+ * @param p the properties
+ */
+ public void setProperties( Map<String, String>p) {
+ properties = p;
+ }
+
+
+ /**
+ * @return metadata type
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Set metadata type
+ *
+ * @param type e.g. VF/CP/SERVICE_PROXY
+ */
+ public void setType(String type) {
+ this.type = type;
+ }
+
+ /**
+ * Extract node.
+ *
+ * @param modelCustomizationName the model customization name
+ * @param nodeTemplate the node template
+ * @return the node
+ */
+ public void extractNode (NodeTemplate nodeTemplate) {
+
+ String methodName = "extractNode";
+
+ setUuid(nodeTemplate.getMetadata().getUUID());
+ setInvariantUuid(nodeTemplate.getMetadata().getInvariantUUID());
+ setDescription(nodeTemplate.getMetadata().getDescription());
+ setName(nodeTemplate.getMetadata().getName());
+ setVersion(nodeTemplate.getMetadata().getVersion());
+ // add customizationUUID
+ setCustomizationUuid(nodeTemplate.getMetadata().getCustomizationUUID());
+
+ try {
+ // nodeTemplate.getProperties() map of String->Object
+ for (Entry<String, Object> e : nodeTemplate.getProperties().entrySet()) {
+
+ String k = e.getKey();
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " node template property: " + k );
+
+ if ( e.getValue() != null ) {
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
+ k + "=" + e.getValue());
+ //LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
+ // e.getValue().getClass().getName());
+ Class<?> c = e.getValue().getClass();
+ if ( c.getName().equalsIgnoreCase(java.lang.String.class.getName())) {
+ getProperties().put (k, (String)e.getValue());
+ }
+ else {
+ Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
+
+ for(Class<?> ifc: interfaces ) {
+ //LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
+ // ifc.getName());
+ if ( ifc.getName().equalsIgnoreCase(java.util.Map.class.getName()) ) {
+ // only extract get_input for now
+ @SuppressWarnings("unchecked")
+ HashMap<String,String> v = (HashMap<String,String>)e.getValue();
+ for (Entry<String, String> entry : v.entrySet()) {
+ // only include get_input for now
+ if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
+ CommandProperty cp = new CommandProperty();
+ cp.setCommand(entry.getKey());
+ cp.setInputName(entry.getValue());
+ cp.setDisplayName(k);
+ getCommands().put(k,cp);
+ }
+ }
+ }
+ }
+
+ }
+ }
+ }
+ }
+ catch ( Exception e ) {
+ LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse node properties: e=" +
+ e.toString());
+ }
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java b/vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java
new file mode 100644
index 000000000..dd3d5db72
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/PortMirroringConfig.java
@@ -0,0 +1,77 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.sdc.toscaparser.api.NodeTemplate;
+import org.openecomp.sdc.toscaparser.api.RequirementAssignments;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.List;
+
+public class PortMirroringConfig extends Node {
+
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(PortMirroringConfig.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /** The model customization name. */
+ private String modelCustomizationName;
+
+ /** The port miroring requirements for source/collector */
+ @JsonIgnore
+ private RequirementAssignments requirementAssignments;
+
+ private List<String> sourceNodes;
+
+ private List<String> collectorNodes;
+
+ private boolean configurationByPolicy;
+
+ public PortMirroringConfig() {
+ super();
+ this.configurationByPolicy = false;
+ }
+
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+
+ public RequirementAssignments getRequirementAssignments() {
+ return requirementAssignments;
+ }
+
+ public void setRequirementAssignments(RequirementAssignments requirementAssignments) {
+ this.requirementAssignments = requirementAssignments;
+ }
+
+ public List<String> getSourceNodes() {
+ return sourceNodes;
+ }
+
+ public void setSourceNodes(List<String> sourceNodes) {
+ this.sourceNodes = sourceNodes;
+ }
+
+ public List<String> getCollectorNodes() {
+ return collectorNodes;
+ }
+
+ public void setCollectorNodes(List<String> collectorNodes) {
+ this.collectorNodes = collectorNodes;
+ }
+
+ public void setConfigurationByPolicy(boolean configurationByPolicy) {
+ this.configurationByPolicy = configurationByPolicy;
+ }
+
+ public boolean isConfigurationByPolicy() {
+ return configurationByPolicy;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java b/vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java
new file mode 100644
index 000000000..1931fa39e
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ProxyResponse.java
@@ -0,0 +1,30 @@
+package org.onap.vid.model;
+
+import com.google.common.base.MoreObjects;
+
+/**
+ * Created by Oren on 7/10/17.
+ */
+public class ProxyResponse {
+
+ protected String errorMessage;
+
+ protected int httpCode;
+
+ public String getErrorMessage() {
+ return errorMessage;
+ }
+
+
+ public int getHttpCode() {
+ return httpCode;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("httpCode", httpCode)
+ .add("errorMessage", errorMessage)
+ .toString();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java b/vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java
new file mode 100644
index 000000000..9c12a52a6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/RequestReferencesContainer.java
@@ -0,0 +1,42 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.*;
+import com.google.common.base.MoreObjects;
+import org.onap.vid.domain.mso.RequestReferences;
+
+import java.util.HashMap;
+import java.util.Map;
+
+@JsonInclude(JsonInclude.Include.NON_NULL)
+public class RequestReferencesContainer {
+ private final RequestReferences requestReferences;
+
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ public RequestReferencesContainer(@JsonProperty("requestReferences") RequestReferences requestReferences) {
+ this.requestReferences = requestReferences;
+ }
+
+ public RequestReferences getRequestReferences() {
+ return requestReferences;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("requestReferences", requestReferences)
+ .add("additionalProperties", additionalProperties)
+ .toString();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java b/vid-app-common/src/main/java/org/onap/vid/model/Resource.java
index 4dcc975b1..184f9ee6e 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Resource.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Resource.java
@@ -1,28 +1,28 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class Resource.
- */
-public class Resource {
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+/**
+ * The Class Resource.
+ */
+public class Resource {
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Result.java b/vid-app-common/src/main/java/org/onap/vid/model/Result.java
index d8bf6eb64..c972bccaa 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Result.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Result.java
@@ -1,58 +1,58 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-/**
- * The Class Result.
- */
-public class Result {
-
- /** The result. */
- private String result;
-
- /**
- * Instantiates a new result.
- *
- * @param result the result
- */
- public Result(String result) {
- this.result = result;
- }
-
- /**
- * Gets the result.
- *
- * @return the result
- */
- public String getResult() {
- return result;
- }
-
- /**
- * Sets the result.
- *
- * @param result the new result
- */
- public void setResult(String result) {
- this.result = result;
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+/**
+ * The Class Result.
+ */
+public class Result {
+
+ /** The result. */
+ private String result;
+
+ /**
+ * Instantiates a new result.
+ *
+ * @param result the result
+ */
+ public Result(String result) {
+ this.result = result;
+ }
+
+ /**
+ * Gets the result.
+ *
+ * @return the result
+ */
+ public String getResult() {
+ return result;
+ }
+
+ /**
+ * Sets the result.
+ *
+ * @param result the new result
+ */
+ public void setResult(String result) {
+ this.result = result;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Service.java b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
index c6269b978..b0597c649 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Service.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Service.java
@@ -1,276 +1,283 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-import java.util.UUID;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-/**
- * The Class Service.
- */
-public class Service {
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant uuid. */
- private String invariantUuid;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
- /** The tosca model URL. */
- private String toscaModelURL;
-
- /** The category. */
- private String category;
-
- /** The Service Type. */
- private String serviceType;
-
- /** The Service Role */
- private String serviceRole;
-
- /** The description. */
- private String description;
-
- /** The service ecomp naming flag */
- private String serviceEcompNaming;
-
- /** The inputs. */
- private Map<String, Input> inputs;
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the invariant uuid.
- *
- * @return the invariant uuid
- */
- public String getInvariantUuid() {
- return invariantUuid;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Gets the tosca model URL.
- *
- * @return the tosca model URL
- */
- public String getToscaModelURL() {
- return toscaModelURL;
- }
-
- /**
- * Gets the category.
- *
- * @return the category
- */
- public String getCategory() {
- return category;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the inputs.
- *
- * @return the inputs
- */
- public Map<String, Input> getInputs() {
- return inputs;
- }
- /**
- * Get the serviceEcompNaming value
- *
- * @return serviceEcompNaming
- */
- public String getServiceEcompNaming() {
- return serviceEcompNaming;
- }
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant uuid.
- *
- * @param invariantUuid the new invariant uuid
- */
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
-
- /**
- * Sets the tosca model URL.
- *
- * @param toscaModelURL the new tosca model URL
- */
- public void setToscaModelURL(String toscaModelURL) {
- this.toscaModelURL = toscaModelURL;
- }
-
- /**
- * Sets the category.
- *
- * @param category the new category
- */
- public void setCategory(String category) {
- this.category = category;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the inputs.
- *
- * @param inputs the inputs
- */
- public void setInputs(Map<String, Input> inputs) {
- this.inputs = inputs;
- }
- /**
- * Sets the service ecomp naming.
- *
- * @param serviceEcompNaming the new service ecomp naming
- */
- public void setServiceEcompNaming(String serviceEcompNaming) {
- this.serviceEcompNaming = serviceEcompNaming;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- final UUID uuid = UUID.fromString(getUuid());
-
- return uuid.hashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object o) {
- if (o == this) return true;
- if (!(o instanceof Service)) return false;
-
- final Service service = (Service) o;
-
- return (service.getUuid().equals(getUuid()));
- }
-
- public String getServiceType() {
- return serviceType;
- }
-
- public void setServiceType(String serviceType) {
- this.serviceType = serviceType;
- }
-
- public String getServiceRole() {
- return serviceRole;
- }
-
- public void setServiceRole(String serviceRole) {
- this.serviceRole = serviceRole;
- }
-
- /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
-
- //Look for vnfCustomizationName..vfModuleCustomizationName
- String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
- for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
- VfModule xMod = vfModuleComponent.getValue();
- if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
- vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
- return;
- }
- }
- }*/
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.Input;
+
+import java.util.Map;
+import java.util.UUID;
+
+/**
+ * The Class Service.
+ */
+public class Service {
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant uuid. */
+ private String invariantUuid;
+
+ /** The name. */
+ private String name;
+
+ /** The version. */
+ private String version;
+
+ /** The tosca model URL. */
+ private String toscaModelURL;
+
+ /** The category. */
+ private String category;
+
+ /** The Service Type. */
+ private String serviceType;
+
+ /** The Service Role */
+ private String serviceRole;
+
+ /** The description. */
+ private String description;
+
+ /** The service ecomp naming flag */
+ private String serviceEcompNaming;
+
+ private String instantiationType;
+
+
+ /** The inputs. */
+ private Map<String, Input> inputs;
+
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * Gets the invariant uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Gets the tosca model URL.
+ *
+ * @return the tosca model URL
+ */
+ public String getToscaModelURL() {
+ return toscaModelURL;
+ }
+
+ /**
+ * Gets the category.
+ *
+ * @return the category
+ */
+ public String getCategory() {
+ return category;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the inputs.
+ *
+ * @return the inputs
+ */
+ public Map<String, Input> getInputs() {
+ return inputs;
+ }
+ /**
+ * Get the serviceEcompNaming value
+ *
+ * @return serviceEcompNaming
+ */
+ public String getServiceEcompNaming() {
+ return serviceEcompNaming;
+ }
+
+
+ public String getInstantiationType() { return instantiationType; }
+
+ public void setInstantiationType(String instantiationType) { this.instantiationType = instantiationType; }
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant uuid.
+ *
+ * @param invariantUuid the new invariant uuid
+ */
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * Sets the tosca model URL.
+ *
+ * @param toscaModelURL the new tosca model URL
+ */
+ public void setToscaModelURL(String toscaModelURL) {
+ this.toscaModelURL = toscaModelURL;
+ }
+
+ /**
+ * Sets the category.
+ *
+ * @param category the new category
+ */
+ public void setCategory(String category) {
+ this.category = category;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the inputs.
+ *
+ * @param inputs the inputs
+ */
+ public void setInputs(Map<String, Input> inputs) {
+ this.inputs = inputs;
+ }
+ /**
+ * Sets the service ecomp naming.
+ *
+ * @param serviceEcompNaming the new service ecomp naming
+ */
+ public void setServiceEcompNaming(String serviceEcompNaming) {
+ this.serviceEcompNaming = serviceEcompNaming;
+ }
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ final UUID uuid = UUID.fromString(getUuid());
+
+ return uuid.hashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object o) {
+ if (o == this) return true;
+ if (!(o instanceof Service)) return false;
+
+ final Service service = (Service) o;
+
+ return (service.getUuid().equals(getUuid()));
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceRole() {
+ return serviceRole;
+ }
+
+ public void setServiceRole(String serviceRole) {
+ this.serviceRole = serviceRole;
+ }
+
+ /*public static void extractVfModuleCustomizationUUID (Service s, String vnfCustomizationName, VfModule vfMod ) {
+
+ //Look for vnfCustomizationName..vfModuleCustomizationName
+ String nameToFind = vnfCustomizationName + ".." + vfMod.getModelCustomizationName();
+ for (Entry<UUID, VfModule> vfModuleComponent : s.getVfModules().entrySet()) {
+ VfModule xMod = vfModuleComponent.getValue();
+ if ( (xMod.getModelCustomizationName() != null) && (xMod.getModelCustomizationName().equalsIgnoreCase(nameToFind)) ) {
+ vfMod.setCustomizationUuid( xMod.getCustomizationUuid());
+ return;
+ }
+ }
+ }*/
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java
new file mode 100644
index 000000000..abf60d689
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceInstanceSearchResult.java
@@ -0,0 +1,139 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+public class ServiceInstanceSearchResult {
+
+ private String serviceInstanceId;
+
+ private String globalCustomerId;
+
+ private String serviceType;
+
+ private String serviceInstanceName;
+
+ private String subscriberName;
+
+ private String aaiModelInvariantId;
+
+ private String aaiModelVersionId;
+
+ private boolean isPermitted;
+
+ public ServiceInstanceSearchResult(){
+
+ }
+ public ServiceInstanceSearchResult(String serviceInstanceId, String globalCustomerId, String serviceType,
+ String serviceInstanceName, String subscriberName, String aaiModelInvariantId,
+ String aaiModelVersionId, boolean isPermitted) {
+ this.serviceInstanceId = serviceInstanceId;
+ this.globalCustomerId = globalCustomerId;
+ this.serviceType = serviceType;
+ this.serviceInstanceName = serviceInstanceName;
+ this.subscriberName = subscriberName;
+ this.aaiModelInvariantId = aaiModelInvariantId;
+ this.aaiModelVersionId = aaiModelVersionId;
+ this.isPermitted = isPermitted;
+ }
+
+ public String getServiceInstanceId() {
+ return serviceInstanceId;
+ }
+
+ public void setServiceInstanceId(String serviceInstanceId) {
+ this.serviceInstanceId = serviceInstanceId;
+ }
+
+ public String getGlobalCustomerId() {
+ return globalCustomerId;
+ }
+
+ public void setGlobalCustomerId(String globalCustomerId) {
+ this.globalCustomerId = globalCustomerId;
+ }
+
+ public String getServiceType() {
+ return serviceType;
+ }
+
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+ public String getServiceInstanceName() {
+ return serviceInstanceName;
+ }
+
+ public void setServiceInstanceName(String serviceInstanceName) {
+ this.serviceInstanceName = serviceInstanceName;
+ }
+
+ public String getSubscriberName() {
+ return subscriberName;
+ }
+
+ public void setSubscriberName(String subscriberName) {
+ this.subscriberName = subscriberName;
+ }
+
+ public String getAaiModelInvariantId() {
+ return aaiModelInvariantId;
+ }
+
+ public void setAaiModelInvariantId(String aaiModelInvariantId) {
+ this.aaiModelInvariantId = aaiModelInvariantId;
+ }
+
+ public String getAaiModelVersionId() {
+ return aaiModelVersionId;
+ }
+
+ public void setAaiModelVersionId(String aaiModelVersionId) {
+ this.aaiModelVersionId = aaiModelVersionId;
+ }
+
+ public boolean getIsPermitted() {
+ return isPermitted;
+ }
+
+ public void setIsPermitted(boolean isPermitted) {
+ this.isPermitted = isPermitted;
+ }
+
+ @Override
+ public boolean equals(Object other){
+ if (other instanceof ServiceInstanceSearchResult) {
+ ServiceInstanceSearchResult serviceInstanceSearchResultOther = (ServiceInstanceSearchResult) other;
+ if (this.getServiceInstanceId().equals(serviceInstanceSearchResultOther.getServiceInstanceId())) {
+ return true;
+ }
+ }
+ return false;
+
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 17;
+ result = 31 * result + serviceInstanceId.hashCode();
+ return result;
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
index e879fd470..dab18d518 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ServiceModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceModel.java
@@ -1,261 +1,330 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-import org.openecomp.vid.asdc.beans.tosca.ToscaModel;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.properties.VidProperties;
-/**
- * The Class ServiceModel.
- */
-@SuppressWarnings("ALL")
-public class ServiceModel {
-
- /** The Constant LOG. */
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceModel.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
- /** The service. */
- private Service service;
-
- /** The vnfs. */
- private Map<String, VNF> vnfs;
-
- /** The networks. */
- private Map<String, Network> networks;
-
- /**
- * The vf modules. The VNF also has vfmodules but the vfmodules at the service level may have additional info
- * that is not present in the VNF, like the vf module customization String
- */
- private Map<String, VfModule> vfModules;
- /**
- * The volume groups. The VNF also has volume groups but the volume groups will be populated at the service level
- * for newer models
- */
- private Map<String, VolumeGroup> volumeGroups;
- /**
- * Instantiates a new service model.
- */
- public ServiceModel() {}
-
- /**
- * Gets the service.
- *
- * @return the service
- */
- public Service getService() {
- return service;
- }
-
- /**
- * Gets the vnfs.
- *
- * @return the vnfs
- */
- public Map<String, VNF> getVnfs() {
- return vnfs;
- }
-
- /**
- * Gets the networks.
- *
- * @return the networks
- */
- public Map<String, Network> getNetworks() {
- return networks;
- }
-
- /**
- * Sets the service.
- *
- * @param service the new service
- */
- public void setService(Service service) {
- this.service = service;
- }
-
- /**
- * Sets the vnfs.
- *
- * @param vnfs the vnfs
- */
- public void setVnfs(Map<String, VNF> vnfs) {
- this.vnfs = vnfs;
- }
-
- /**
- * Sets the networks.
- *
- * @param networks the networks
- */
- public void setNetworks(Map<String, Network> networks) {
- this.networks = networks;
- }
- /**
- * Gets the vf modules.
- *
- * @return the vf modules
- */
- public Map<String, VfModule> getVfModules() {
- return vfModules;
- }
- /**
- * Gets the volume groups.
- *
- * @return the volume groups
- */
- public Map<String, VolumeGroup> getVolumeGroups() {
- return volumeGroups;
- }
- /**
- * Sets the vf modules.
- *
- * @param vfModules the vf modules
- */
- public void setVfModules(Map<String, VfModule> vfModules) {
- this.vfModules = vfModules;
- }
- /**
- * Sets the volume groups.
- *
- * @param volumeGroups the volume groups
- */
- public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
- this.volumeGroups = volumeGroups;
- }
- /**
- * Extract service.
- *
- * @param serviceToscaModel the service tosca model
- * @param asdcServiceMetadata the asdc service metadata
- * @return the service
- */
- public static Service extractService(ToscaModel serviceToscaModel, org.openecomp.vid.asdc.beans.Service asdcServiceMetadata) {
-
- final Service service = new Service();
-
- service.setCategory(serviceToscaModel.getMetadata().getCategory());
- service.setInvariantUuid(serviceToscaModel.getMetadata().getInvariantUUID());
- service.setName(serviceToscaModel.getMetadata().getName());
- service.setUuid(serviceToscaModel.getMetadata().getUUID());
- service.setDescription(serviceToscaModel.getMetadata().getDescription());
- service.setServiceEcompNaming(serviceToscaModel.getMetadata().getServiceEcompNaming());
- service.setInputs(serviceToscaModel.gettopology_template().getInputs());
- //FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702
- //THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME
- service.setVersion(serviceToscaModel.getMetadata().getVersion());
- //service.setVersion(asdcServiceMetadata.getVersion());
-
- return service;
- }
- public static void extractGroups (ToscaModel serviceToscaModel,ServiceModel serviceModel) {
- // Get the groups. The groups may duplicate the groups that are in the VNF model and have
- // additional data like the VF module customization String>
-
- final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
- final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
-
- String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
- String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
-
- for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {
- final Group group = component.getValue();
- final String type = group.getType();
- final String customizationName = component.getKey();
-
- if (type.startsWith(vfModuleTag)) {
- VfModule vfMod = VfModule.extractVfModule(customizationName, group);
- vfModules.put(customizationName, vfMod);
- if ( vfMod.isVolumeGroupAllowed() ) {
- //volume groups have the same customization name as the vf module
- volumeGroups.put(customizationName, VolumeGroup.extractVolumeGroup(customizationName,group));
- }
- }
- }
- // add this point vfModules and volume groups are disconnected from VNF
- serviceModel.setVfModules (vfModules);
- serviceModel.setVolumeGroups (volumeGroups);
-
- }
- /**
- * Populate the vf modules and volume groups that we may have under the service level under each VNF.
- */
- public void associateGroups() {
- String methodName = "associateGroups()";
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
- // go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts
- // with vnf + ".."
- String vnfCustomizationName = null;
- String normalizedVnfCustomizationName = null;
- String vfModuleCustomizationName = null;
- VNF tmpVnf = null;
-
- if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
- for (Entry<String, VNF> vnfComponent : getVnfs().entrySet()) {
- vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
- normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
-
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
- " VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
-
- // now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
-
- if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
- for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
- vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
-
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
- " VF Module customizationName=" + vfModuleCustomizationName );
- if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
-
- // this vf module belongs to the VNF
- tmpVnf = vnfComponent.getValue();
- (tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
-
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
- " Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
-
- // now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
- if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
- if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
- if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
- (vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
- }
- }
- }
- }
- }
- }
- }
- }
-
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+import org.onap.vid.asdc.beans.tosca.ToscaModel;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.properties.VidProperties;
+/**
+ * The Class ServiceModel.
+ */
+@SuppressWarnings("ALL")
+public class ServiceModel {
+
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceModel.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+ /** The service. */
+ private Service service;
+
+ /** The vnfs. */
+ private Map<String, VNF> vnfs;
+
+ /** The networks. */
+ private Map<String, Network> networks;
+
+ /** Port Mirroring Configuration node templates */
+ private Map<String, PortMirroringConfig> configurations;
+
+ /** Service Proxy Nodes */
+ private Map<String, ServiceProxy> serviceProxies;
+
+ /**
+ * The vf modules. The VNF also has vfmodules but the vfmodules at the service level may have additional info
+ * that is not present in the VNF, like the vf module customization String
+ */
+ private Map<String, VfModule> vfModules;
+ /**
+ * The volume groups. The VNF also has volume groups but the volume groups will be populated at the service level
+ * for newer models
+ */
+ private Map<String, VolumeGroup> volumeGroups;
+
+ /** The pnfs. */
+ private Map<String, Node> pnfs;
+ /**
+ * Instantiates a new service model.
+ */
+ public ServiceModel() {}
+
+ /**
+ * Gets the service.
+ *
+ * @return the service
+ */
+ public Service getService() {
+ return service;
+ }
+
+ /**
+ * Gets the vnfs.
+ *
+ * @return the vnfs
+ */
+ public Map<String, VNF> getVnfs() {
+ return vnfs;
+ }
+
+ /**
+ * Gets the networks.
+ *
+ * @return the networks
+ */
+ public Map<String, Network> getNetworks() {
+ return networks;
+ }
+
+
+ /**
+ * Gets the pnfs.
+ *
+ * @return the pnfs
+ */
+ public Map<String, Node> getPnfs() {
+ return pnfs;
+ }
+
+
+ /**
+ * Gets the Configuration Node Templates
+ *
+ * @return the configuration type node templates
+ */
+ public Map<String, PortMirroringConfig> getConfigurations() {
+ return configurations;
+ }
+
+ /**
+ * Gets the Service Proxy Node Templates
+ *
+ * @return the Service Proxy type node templates
+ */
+ public Map<String, ServiceProxy> getServiceProxies() {
+ return serviceProxies;
+ }
+
+ /**
+ * Sets the service.
+ *
+ * @param service the new service
+ */
+ public void setService(Service service) {
+ this.service = service;
+ }
+
+ /**
+ * Sets the vnfs.
+ *
+ * @param vnfs the vnfs
+ */
+ public void setVnfs(Map<String, VNF> vnfs) {
+ this.vnfs = vnfs;
+ }
+
+ /**
+ * Sets the networks.
+ *
+ * @param networks the networks
+ */
+ public void setNetworks(Map<String, Network> networks) {
+ this.networks = networks;
+ }
+
+ /**
+ * Sets the configuraion node templates.
+ *
+ * @param configurations
+ */
+ public void setConfigurations(Map<String, PortMirroringConfig> configurations) {
+ this.configurations = configurations;
+ }
+
+ /**
+ * Sets the service proxy node templates.
+ *
+ * @param serviceProxies
+ */
+ public void setServiceProxies(Map<String, ServiceProxy> serviceProxies) {
+ this.serviceProxies = serviceProxies;
+ }
+
+ /**
+ * Gets the vf modules.
+ *
+ * @return the vf modules
+ */
+ public Map<String, VfModule> getVfModules() {
+ return vfModules;
+ }
+
+
+ /**
+ * Gets the volume groups.
+ *
+ * @return the volume groups
+ */
+ public Map<String, VolumeGroup> getVolumeGroups() {
+ return volumeGroups;
+ }
+ /**
+ * Sets the vf modules.
+ *
+ * @param vfModules the vf modules
+ */
+ public void setVfModules(Map<String, VfModule> vfModules) {
+ this.vfModules = vfModules;
+ }
+ /**
+ * Sets the volume groups.
+ *
+ * @param volumeGroups the volume groups
+ */
+ public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
+ this.volumeGroups = volumeGroups;
+ }
+ /**
+ * Sets the pnfs.
+ *
+ * @param pnfs the pnfs
+ */
+ public void setPnfs(Map<String,Node> pnfs) {this.pnfs = pnfs;}
+
+ /**
+ * Extract service.
+ *
+ * @param serviceToscaModel the service tosca model
+ * @param asdcServiceMetadata the asdc service metadata
+ * @return the service
+ */
+ public static Service extractService(ToscaModel serviceToscaModel, org.onap.vid.asdc.beans.Service asdcServiceMetadata) {
+
+ final Service service = new Service();
+
+ service.setCategory(serviceToscaModel.getMetadata().getCategory());
+ service.setInvariantUuid(serviceToscaModel.getMetadata().getInvariantUUID());
+ service.setName(serviceToscaModel.getMetadata().getName());
+ service.setUuid(serviceToscaModel.getMetadata().getUUID());
+ service.setDescription(serviceToscaModel.getMetadata().getDescription());
+ service.setServiceEcompNaming(serviceToscaModel.getMetadata().getServiceEcompNaming());
+ service.setInputs(serviceToscaModel.gettopology_template().getInputs());
+ //FIXME: SDC is not sending the Version with the Tosca Model for 1610 - they should send it in 1702
+ //THIS IS A TEMPORARY FIX, AT SOME POINT UNCOMMENT ME
+ //service.setVersion(serviceToscaModel.getMetadata().getVersion());
+ service.setVersion(asdcServiceMetadata.getVersion());
+
+ return service;
+ }
+ public static void extractGroups (ToscaModel serviceToscaModel,ServiceModel serviceModel) {
+ // Get the groups. The groups may duplicate the groups that are in the VNF model and have
+ // additional data like the VF module customization String>
+
+ final Map<String, VfModule> vfModules = new HashMap<String, VfModule> ();
+ final Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup> ();
+
+ String asdcModelNamespace = VidProperties.getAsdcModelNamespace();
+ String vfModuleTag = asdcModelNamespace + ModelConstants.VF_MODULE;
+
+ for (Entry<String, Group> component : serviceToscaModel.gettopology_template().getGroups().entrySet()) {
+ final Group group = component.getValue();
+ final String type = group.getType();
+ final String customizationName = component.getKey();
+
+ if (type.startsWith(vfModuleTag)) {
+ VfModule vfMod = VfModule.extractVfModule(customizationName, group);
+ vfModules.put(customizationName, vfMod);
+ if ( vfMod.isVolumeGroupAllowed() ) {
+ //volume groups have the same customization name as the vf module
+ volumeGroups.put(customizationName, VolumeGroup.extractVolumeGroup(customizationName,group));
+ }
+ }
+ }
+ // add this point vfModules and volume groups are disconnected from VNF
+ serviceModel.setVfModules (vfModules);
+ serviceModel.setVolumeGroups (volumeGroups);
+
+ }
+ /**
+ * Populate the vf modules and volume groups that we may have under the service level under each VNF.
+ */
+ public void associateGroups() {
+ String methodName = "associateGroups()";
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " start");
+ // go through the vnfs, get the vnf normalized name and look for a vf module with a customization name that starts
+ // with vnf + ".."
+ String vnfCustomizationName = null;
+ String normalizedVnfCustomizationName = null;
+ String vfModuleCustomizationName = null;
+ VNF tmpVnf = null;
+
+ if ( ( getVnfs() != null ) && (!(getVnfs().isEmpty())) ) {
+ for (Entry<String, VNF> vnfComponent : getVnfs().entrySet()) {
+ vnfCustomizationName = vnfComponent.getValue().getModelCustomizationName();
+ normalizedVnfCustomizationName = VNF.normalizeName(vnfCustomizationName);
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+ " VNF customizationName=" + vnfCustomizationName + "normalized customization name=" + normalizedVnfCustomizationName);
+
+ // now check to see if there is a vf module with customization name that starts with normalizedVnfCustomizationName
+
+ if (( getVfModules() != null ) && (!(getVfModules().isEmpty()))) {
+ for (Entry<String, VfModule> vfModuleComponent : getVfModules().entrySet()) {
+ vfModuleCustomizationName = vfModuleComponent.getValue().getModelCustomizationName();
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+ " VF Module customizationName=" + vfModuleCustomizationName );
+ if ( vfModuleCustomizationName.startsWith(normalizedVnfCustomizationName + ".." )) {
+
+ // this vf module belongs to the VNF
+ tmpVnf = vnfComponent.getValue();
+ (tmpVnf.getVfModules()).put(vfModuleComponent.getKey(), vfModuleComponent.getValue());
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName +
+ " Associated VF Module customizationName=" + vfModuleComponent.getKey() + " with VNF customization name=" + vnfCustomizationName);
+
+ // now find if this vf module has volume groups, if so, find the volume group with the same customization name and put it under the VNF
+ if ( vfModuleComponent.getValue().isVolumeGroupAllowed() ) {
+ if (( getVolumeGroups() != null ) && (!(getVolumeGroups().isEmpty()))) {
+ if (getVolumeGroups().containsKey((vfModuleCustomizationName))) {
+ (vnfComponent.getValue().getVolumeGroups()).put(vfModuleCustomizationName, (getVolumeGroups()).get(vfModuleCustomizationName));
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java b/vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java
new file mode 100644
index 000000000..f412a1e51
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/ServiceProxy.java
@@ -0,0 +1,46 @@
+package org.onap.vid.model;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+public class ServiceProxy extends Node {
+
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(ServiceProxy.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ private String sourceModelUuid;
+
+ private String sourceModelInvariant;
+
+ private String sourceModelName;
+
+ public String getSourceModelUuid() {
+ return sourceModelUuid;
+ }
+
+ public void setSourceModelUuid(String sourceModelUuid) {
+ this.sourceModelUuid = sourceModelUuid;
+ }
+
+ public String getSourceModelInvariant() {
+ return sourceModelInvariant;
+ }
+
+ public void setSourceModelInvariant(String sourceModelInvariant) {
+ this.sourceModelInvariant = sourceModelInvariant;
+ }
+
+ public String getSourceModelName() {
+ return sourceModelName;
+ }
+
+ public void setSourceModelName(String sourceModelName) {
+ this.sourceModelName = sourceModelName;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java b/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
index c5db6fdae..70711b804 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Subscriber.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Subscriber.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import org.codehaus.jackson.annotate.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
index 7f593e4de..5f935971e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/SubscriberList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/SubscriberList.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import org.openecomp.portalsdk.core.web.support.UserUtils;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
index 62e101ef8..e558e9574 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VNF.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VNF.java
@@ -1,165 +1,165 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.util.Map;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map.Entry;
-import java.util.regex.Pattern;
-
-import org.openecomp.vid.asdc.beans.tosca.NodeTemplate;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.controller.VidController;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-import org.openecomp.vid.asdc.beans.tosca.Input;
-
-/**
- * The Class VNF.
- */
-public class VNF extends Node {
-
- /** The Constant LOG. */
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VNF.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The pattern used to normalize VNF names */
- final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
-
- /** The model customization name. */
- private String modelCustomizationName;
-
- /** The vf modules. */
- private Map<String, VfModule> vfModules = new HashMap<String, VfModule>();
-
- /** The volume groups. */
- private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
-
- /**
- * Instantiates a new vnf.
- */
- public VNF() {
- super();
- }
-
- /**
- * Gets the model customization name.
- *
- * @return the model customization name
- */
- public String getModelCustomizationName() {
- return modelCustomizationName;
- }
-
- /**
- * Gets the vf modules.
- *
- * @return the vf modules
- */
- public Map<String, VfModule> getVfModules() {
- return vfModules;
- }
-
- /**
- * Sets the vf modules.
- *
- * @param vfModules the vf modules
- */
- public void setVfModules(Map<String, VfModule> vfModules) {
- this.vfModules = vfModules;
- }
-
- /**
- * Gets the volume groups.
- *
- * @return the volume groups
- */
- public Map<String, VolumeGroup> getVolumeGroups() {
- return volumeGroups;
- }
-
- /**
- * Sets the volume groups.
- *
- * @param volumeGroups the volume groups
- */
- public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
- this.volumeGroups = volumeGroups;
- }
-
- /**
- * Extract vnf.
- *
- * @param modelCustomizationName the model customization name
- * @param nodeTemplate the node template
- * @return the vnf
- */
- public void extractVnf(String modelCustomizationName, NodeTemplate nodeTemplate) {
-
- super.extractNode(nodeTemplate);
- setModelCustomizationName(modelCustomizationName);
-
- }
-
- /**
- * Sets the model customization name.
- *
- * @param modelCustomizationName the new model customization name
- */
- public void setModelCustomizationName(String modelCustomizationName) {
- this.modelCustomizationName = modelCustomizationName;
- }
- /**
- * Normalize the VNF name
- * @param originalName
- * @return the normalized name
- */
- public static String normalizeName (String originalName) {
-
- String normalizedName = originalName.toLowerCase();
- normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
- String[] splitArr = null;
-
- try {
- splitArr = normalizedName.split(" ");
- }
- catch (Exception ex ) {
- return (normalizedName);
- }
- StringBuffer sb = new StringBuffer();
- if ( splitArr != null ) {
- for (String splitElement : splitArr) {
- sb.append(splitElement);
- }
- return (sb.toString());
- }
- else {
- return (normalizedName);
- }
-
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.util.Map;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map.Entry;
+import java.util.regex.Pattern;
+
+import org.onap.vid.asdc.beans.tosca.NodeTemplate;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.controller.VidController;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+import org.onap.vid.asdc.beans.tosca.Input;
+
+/**
+ * The Class VNF.
+ */
+public class VNF extends Node {
+
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VNF.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /** The pattern used to normalize VNF names */
+ final static Pattern COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN = Pattern.compile("[\\.\\-]+");
+
+ /** The model customization name. */
+ private String modelCustomizationName;
+
+ /** The vf modules. */
+ private Map<String, VfModule> vfModules = new HashMap<String, VfModule>();
+
+ /** The volume groups. */
+ private Map<String, VolumeGroup> volumeGroups = new HashMap<String, VolumeGroup>();
+
+ /**
+ * Instantiates a new vnf.
+ */
+ public VNF() {
+ super();
+ }
+
+ /**
+ * Gets the model customization name.
+ *
+ * @return the model customization name
+ */
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+
+ /**
+ * Gets the vf modules.
+ *
+ * @return the vf modules
+ */
+ public Map<String, VfModule> getVfModules() {
+ return vfModules;
+ }
+
+ /**
+ * Sets the vf modules.
+ *
+ * @param vfModules the vf modules
+ */
+ public void setVfModules(Map<String, VfModule> vfModules) {
+ this.vfModules = vfModules;
+ }
+
+ /**
+ * Gets the volume groups.
+ *
+ * @return the volume groups
+ */
+ public Map<String, VolumeGroup> getVolumeGroups() {
+ return volumeGroups;
+ }
+
+ /**
+ * Sets the volume groups.
+ *
+ * @param volumeGroups the volume groups
+ */
+ public void setVolumeGroups(Map<String, VolumeGroup> volumeGroups) {
+ this.volumeGroups = volumeGroups;
+ }
+
+ /**
+ * Extract vnf.
+ *
+ * @param modelCustomizationName the model customization name
+ * @param nodeTemplate the node template
+ * @return the vnf
+ */
+ public void extractVnf(String modelCustomizationName, NodeTemplate nodeTemplate) {
+
+ super.extractNode(nodeTemplate);
+ setModelCustomizationName(modelCustomizationName);
+
+ }
+
+ /**
+ * Sets the model customization name.
+ *
+ * @param modelCustomizationName the new model customization name
+ */
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+ /**
+ * Normalize the VNF name
+ * @param originalName
+ * @return the normalized name
+ */
+ public static String normalizeName (String originalName) {
+
+ String normalizedName = originalName.toLowerCase();
+ normalizedName = COMPONENT_INSTANCE_NAME_DELIMETER_PATTERN.matcher(normalizedName).replaceAll(" ");
+ String[] splitArr = null;
+
+ try {
+ splitArr = normalizedName.split(" ");
+ }
+ catch (Exception ex ) {
+ return (normalizedName);
+ }
+ StringBuffer sb = new StringBuffer();
+ if ( splitArr != null ) {
+ for (String splitElement : splitArr) {
+ sb.append(splitElement);
+ }
+ return (sb.toString());
+ }
+ else {
+ return (normalizedName);
+ }
+
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java b/vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java
new file mode 100644
index 000000000..13e2ebb56
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VNFDao.java
@@ -0,0 +1,105 @@
+package org.onap.vid.model;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.HashSet;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_vnf")
+public class VNFDao extends DomainVo {
+
+ private String vnfUUID;
+ private String vnfInvariantUUID;
+ private Set<VidWorkflow> workflows = new HashSet<>(0);
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "VNF_DB_ID")
+ @JsonIgnore
+ public Long getId() {
+ return id;
+ }
+
+ @Override
+ @Column(name = "CREATED_DATE")
+ @JsonIgnore
+ public Date getCreated() {
+ return super.getCreated();
+ }
+
+ @Override
+ @Column(name = "MODIFIED_DATE")
+ @JsonIgnore
+ public Date getModified() {
+ return super.getModified();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getCreatedId() {
+ return super.getCreatedId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getModifiedId() {
+ return super.getModifiedId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Serializable getAuditUserId() {
+ return super.getAuditUserId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getRowNum() {
+ return super.getRowNum();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Set getAuditTrail() {
+ return super.getAuditTrail();
+ }
+
+ @Column(name = "VNF_APP_UUID")
+ public String getVnfUUID() {
+ return vnfUUID;
+ }
+
+ @Column(name = "VNF_APP_INVARIANT_UUID")
+ public String getVnfInvariantUUID() {
+ return vnfInvariantUUID;
+ }
+
+
+ public void setVnfUUID(String vnfUUID) {
+ this.vnfUUID = vnfUUID;
+ }
+
+ public void setVnfInvariantUUID(String vnfInvariantUUID) {
+ this.vnfInvariantUUID = vnfInvariantUUID;
+ }
+
+ @ManyToMany(cascade = CascadeType.ALL, fetch =FetchType.EAGER )
+ @JoinTable(name = "vid_vnf_workflow", joinColumns = { @JoinColumn(name = "VNF_DB_ID") }, inverseJoinColumns = { @JoinColumn(name = "WORKFLOW_DB_ID") })
+ public Set<VidWorkflow> getWorkflows() {
+ return workflows;
+ }
+
+ public void setWorkflows(Set<VidWorkflow> workflows) {
+ this.workflows = workflows;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java b/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
index 7c86165b4..907f4938d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VersionByInvariantIdsRequest.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VersionByInvariantIdsRequest.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
index 3f6f1da22..ac19587e1 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VfModule.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VfModule.java
@@ -1,308 +1,308 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import org.openecomp.vid.asdc.beans.tosca.Group;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- * The Class VfModule.
- */
-public class VfModule {
-
- /** The Constant LOG. */
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VfModule.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant uuid. */
- private String invariantUuid;
-
- /** The customization uuid. */
- private String customizationUuid;
-
- /** The description. */
- private String description;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
- /** The volume group allowed. */
- private boolean volumeGroupAllowed;
-
- /** The get_input or other constructs for VF Module. */
- private Map<String, CommandProperty> commands;
-
- /** The model customization name. */
- private String modelCustomizationName;
-
- /**
- * Instantiates a new vf module.
- */
- public VfModule() {
- commands = new HashMap<String, CommandProperty>();
- }
- /**
- * Gets the model customization name.
- *
- * @return the model customization name
- */
- public String getModelCustomizationName() {
- return modelCustomizationName;
- }
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
-
- /**
- * Gets the invariant uuid.
- *
- * @return the invariant uuid
- */
- public String getInvariantUuid() {
- return invariantUuid;
- }
- /**
- * Gets the customization uuid.
- *
- * @return the invariant uuid
- */
- public String getCustomizationUuid() {
- return customizationUuid;
- }
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
- /**
- * Gets the commands.
- *
- * @return the commands
- */
- public Map<String, CommandProperty> getCommands() {
- return commands;
- }
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Checks if is volume group allowed.
- *
- * @return true, if is volume group allowed
- */
- public boolean isVolumeGroupAllowed() {
- return volumeGroupAllowed;
- }
-
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant uuid.
- *
- * @param invariantUuid the new invariant uuid
- */
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
- /**
- * Sets the customization uuid.
- *
- * @param customizationUuid the new customization uuid
- */
- public void setCustomizationUuid(String customizationUuid) {
- this.customizationUuid = customizationUuid;
- }
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
-
- /**
- * Sets the volume group allowed.
- *
- * @param volumeGroupAllowed the new volume group allowed
- */
- public void setVolumeGroupAllowed(boolean volumeGroupAllowed) {
- this.volumeGroupAllowed = volumeGroupAllowed;
- }
- /**
- * Sets the commands.
- *
- * @param m the commands
- */
- public void setCommands( Map<String, CommandProperty>m ) {
- commands = m;
- }
- /**
- * Sets the model customization name.
- *
- * @param modelCustomizationName the new model customization name
- */
- public void setModelCustomizationName(String modelCustomizationName) {
- this.modelCustomizationName = modelCustomizationName;
- }
- /**
- * Extract vf module.
- *
- * @param group the group
- * @return the vf module
- */
- public static VfModule extractVfModule(String modelCustomizationName, Group group) {
-
- String methodName = "extractVfModule";
-
- final VfModule vfModule = new VfModule();
-
- try {
- vfModule.setUuid(group.getMetadata().getVfModuleModelUUID());
- vfModule.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
- vfModule.setDescription(group.getMetadata().getDescription());
- vfModule.setName(group.getMetadata().getVfModuleModelName());
- vfModule.setVersion(group.getMetadata().getVfModuleModelVersion());
- vfModule.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
- vfModule.setModelCustomizationName (modelCustomizationName);
-
- if (group.getProperties().containsKey("volume_group")) {
- if (group.getProperties().get("volume_group") != null) {
-
- Class<?> c = group.getProperties().get("volume_group").getClass();
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " class name=" +
- c.getName());
-
- if ( c.getName().equalsIgnoreCase(Boolean.class.getName()) ) {
- Boolean b = (Boolean)group.getProperties().get("volume_group");
- vfModule.setVolumeGroupAllowed( b.booleanValue() );
- }
- }
- } else {
- vfModule.setVolumeGroupAllowed(false);
- }
- }
- catch ( Exception e ) {
- LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module from group: e=" +
- e.toString());
- }
- /* Not extracting other types of properties for 1702
- try {
-
- for (Entry<String, Object> e : group.getProperties().entrySet()) {
-
- String k = e.getKey();
- if ( e.getValue() != null ) {
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
- k + "=" + e.getValue());
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
- e.getValue().getClass().getName());
- Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
-
- for(Class<?> ifc: interfaces ){
- LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
- ifc.getName());
- }
-
- // only extract get_input for now
- for (Entry<String, String> entry : v.entrySet()) {
- // only include get_input for now
- if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
- CommandProperty cp = new CommandProperty();
- cp.setDisplayName(entry.getValue());
- cp.setCommand(entry.getKey());
- cp.setInputName(k);
- (vfModule.getCommands()).put(k,cp);
- }
- }
- }
- }
- }
- catch ( Exception e ) {
- LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module properties: e=" +
- e.toString());
- }*/
- return vfModule;
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+import org.onap.vid.asdc.beans.tosca.Group;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+/**
+ * The Class VfModule.
+ */
+public class VfModule {
+
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VfModule.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant uuid. */
+ private String invariantUuid;
+
+ /** The customization uuid. */
+ private String customizationUuid;
+
+ /** The description. */
+ private String description;
+
+ /** The name. */
+ private String name;
+
+ /** The version. */
+ private String version;
+
+ /** The volume group allowed. */
+ private boolean volumeGroupAllowed;
+
+ /** The get_input or other constructs for VF Module. */
+ private Map<String, CommandProperty> commands;
+
+ /** The model customization name. */
+ private String modelCustomizationName;
+
+ /**
+ * Instantiates a new vf module.
+ */
+ public VfModule() {
+ commands = new HashMap<String, CommandProperty>();
+ }
+ /**
+ * Gets the model customization name.
+ *
+ * @return the model customization name
+ */
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+
+ /**
+ * Gets the invariant uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+ /**
+ * Gets the customization uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getCustomizationUuid() {
+ return customizationUuid;
+ }
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+ /**
+ * Gets the commands.
+ *
+ * @return the commands
+ */
+ public Map<String, CommandProperty> getCommands() {
+ return commands;
+ }
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Checks if is volume group allowed.
+ *
+ * @return true, if is volume group allowed
+ */
+ public boolean isVolumeGroupAllowed() {
+ return volumeGroupAllowed;
+ }
+
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant uuid.
+ *
+ * @param invariantUuid the new invariant uuid
+ */
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+ /**
+ * Sets the customization uuid.
+ *
+ * @param customizationUuid the new customization uuid
+ */
+ public void setCustomizationUuid(String customizationUuid) {
+ this.customizationUuid = customizationUuid;
+ }
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+
+ /**
+ * Sets the volume group allowed.
+ *
+ * @param volumeGroupAllowed the new volume group allowed
+ */
+ public void setVolumeGroupAllowed(boolean volumeGroupAllowed) {
+ this.volumeGroupAllowed = volumeGroupAllowed;
+ }
+ /**
+ * Sets the commands.
+ *
+ * @param m the commands
+ */
+ public void setCommands( Map<String, CommandProperty>m ) {
+ commands = m;
+ }
+ /**
+ * Sets the model customization name.
+ *
+ * @param modelCustomizationName the new model customization name
+ */
+ public void setModelCustomizationName(String modelCustomizationName) {
+ this.modelCustomizationName = modelCustomizationName;
+ }
+ /**
+ * Extract vf module.
+ *
+ * @param group the group
+ * @return the vf module
+ */
+ public static VfModule extractVfModule(String modelCustomizationName, Group group) {
+
+ String methodName = "extractVfModule";
+
+ final VfModule vfModule = new VfModule();
+
+ try {
+ vfModule.setUuid(group.getMetadata().getVfModuleModelUUID());
+ vfModule.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
+ vfModule.setDescription(group.getMetadata().getDescription());
+ vfModule.setName(group.getMetadata().getVfModuleModelName());
+ vfModule.setVersion(group.getMetadata().getVfModuleModelVersion());
+ vfModule.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
+ vfModule.setModelCustomizationName (modelCustomizationName);
+
+ if (group.getProperties().containsKey("volume_group")) {
+ if (group.getProperties().get("volume_group") != null) {
+
+ Class<?> c = group.getProperties().get("volume_group").getClass();
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " class name=" +
+ c.getName());
+
+ if ( c.getName().equalsIgnoreCase(Boolean.class.getName()) ) {
+ Boolean b = (Boolean)group.getProperties().get("volume_group");
+ vfModule.setVolumeGroupAllowed( b.booleanValue() );
+ }
+ }
+ } else {
+ vfModule.setVolumeGroupAllowed(false);
+ }
+ }
+ catch ( Exception e ) {
+ LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module from group: e=" +
+ e.toString());
+ }
+ /* Not extracting other types of properties for 1702
+ try {
+
+ for (Entry<String, Object> e : group.getProperties().entrySet()) {
+
+ String k = e.getKey();
+ if ( e.getValue() != null ) {
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " property: " +
+ k + "=" + e.getValue());
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " V class name: " +
+ e.getValue().getClass().getName());
+ Class<?>[] interfaces = e.getValue().getClass().getInterfaces();
+
+ for(Class<?> ifc: interfaces ){
+ LOG.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " ifc name: " +
+ ifc.getName());
+ }
+
+ // only extract get_input for now
+ for (Entry<String, String> entry : v.entrySet()) {
+ // only include get_input for now
+ if ( ModelConstants.GET_INPUT_TAG.equalsIgnoreCase ( entry.getKey() ) ) {
+ CommandProperty cp = new CommandProperty();
+ cp.setDisplayName(entry.getValue());
+ cp.setCommand(entry.getKey());
+ cp.setInputName(k);
+ (vfModule.getCommands()).put(k,cp);
+ }
+ }
+ }
+ }
+ }
+ catch ( Exception e ) {
+ LOG.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + " Unable to parse VF Module properties: e=" +
+ e.toString());
+ }*/
+ return vfModule;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java b/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
new file mode 100644
index 000000000..985289b4a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VidWorkflow.java
@@ -0,0 +1,83 @@
+package org.onap.vid.model;
+
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.openecomp.portalsdk.core.domain.support.DomainVo;
+
+import javax.persistence.*;
+import java.io.Serializable;
+import java.util.Date;
+import java.util.Set;
+
+@Entity
+@Table(name = "vid_workflow")
+public class VidWorkflow extends DomainVo {
+
+ private String wokflowName;
+
+ @Id
+ @GeneratedValue(strategy = GenerationType.IDENTITY)
+ @Column(name = "WORKFLOW_DB_ID")
+ @JsonIgnore
+ public Long getId() {
+ return id;
+ }
+
+ @Override
+ @Column(name = "CREATED_DATE")
+ @JsonIgnore
+ public Date getCreated() {
+ return super.getCreated();
+ }
+
+ @Override
+ @Column(name = "MODIFIED_DATE")
+ @JsonIgnore
+ public Date getModified() {
+ return super.getModified();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getCreatedId() {
+ return super.getCreatedId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getModifiedId() {
+ return super.getModifiedId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Serializable getAuditUserId() {
+ return super.getAuditUserId();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Long getRowNum() {
+ return super.getRowNum();
+ }
+
+ @Override
+ @Transient
+ @JsonIgnore
+ public Set getAuditTrail() {
+ return super.getAuditTrail();
+ }
+
+ @Column(name = "WORKFLOW_APP_NAME")
+ public String getWokflowName() {
+ return wokflowName;
+ }
+
+ public void setWokflowName(String wokflowName) {
+ this.wokflowName = wokflowName;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
index baa535171..969c287ce 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/VolumeGroup.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/VolumeGroup.java
@@ -1,196 +1,196 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.model;
-
-import org.openecomp.vid.asdc.beans.tosca.Group;
-
-/**
- * The Class VolumeGroup.
- */
-public class VolumeGroup {
-
- /** The uuid. */
- private String uuid;
-
- /** The invariant uuid. */
- private String invariantUuid;
-
- /** The description. */
- private String description;
-
- /** The name. */
- private String name;
-
- /** The version. */
- private String version;
-
- /** The customization uuid. */
- private String customizationUuid;
-
- /** The customization uuid. */
- private String modelCustomizationName;
- /**
- * Instantiates a new volume group.
- */
- public VolumeGroup() {}
-
- /**
- * Gets the uuid.
- *
- * @return the uuid
- */
- public String getUuid() {
- return uuid;
- }
- /**
- * Gets the customization uuid.
- *
- * @return the customization uuid
- */
- public String getCustomizationUuid() {
- return customizationUuid;
- }
- /**
- * Gets the customization name.
- *
- * @return the customization name
- */
- public String getModelCustomizationName() {
- return modelCustomizationName;
- }
- /**
- * Gets the invariant uuid.
- *
- * @return the invariant uuid
- */
- public String getInvariantUuid() {
- return invariantUuid;
- }
-
- /**
- * Gets the description.
- *
- * @return the description
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * Gets the name.
- *
- * @return the name
- */
- public String getName() {
- return name;
- }
-
- /**
- * Gets the version.
- *
- * @return the version
- */
- public String getVersion() {
- return version;
- }
-
- /**
- * Sets the uuid.
- *
- * @param uuid the new uuid
- */
- public void setUuid(String uuid) {
- this.uuid = uuid;
- }
-
- /**
- * Sets the invariant uuid.
- *
- * @param invariantUuid the new invariant uuid
- */
- public void setInvariantUuid(String invariantUuid) {
- this.invariantUuid = invariantUuid;
- }
-
- /**
- * Sets the description.
- *
- * @param description the new description
- */
- public void setDescription(String description) {
- this.description = description;
- }
-
- /**
- * Sets the name.
- *
- * @param name the new name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * Sets the version.
- *
- * @param version the new version
- */
- public void setVersion(String version) {
- this.version = version;
- }
- /**
- * Sets the customization uuid.
- *
- * @param u the new customization uuid
- */
- public void setCustomizationUuid(String u) {
- this.customizationUuid = u;
-
- }
- /**
- * Sets the customization name.
- *
- * @param u the new customization name
- */
- public void setModelCustomizationName(String u) {
- this.modelCustomizationName = u;
-
- }
- /**
- * Extract volume group.
- *
- * @param group the group
- * @return the volume group
- */
- public static VolumeGroup extractVolumeGroup(String modelCustomizationName, Group group) {
- final VolumeGroup volumeGroup = new VolumeGroup();
-
- volumeGroup.setUuid(group.getMetadata().getVfModuleModelUUID());
- volumeGroup.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
- volumeGroup.setDescription(group.getMetadata().getDescription());
- volumeGroup.setName(group.getMetadata().getVfModuleModelName());
- volumeGroup.setVersion(group.getMetadata().getVfModuleModelVersion());
- volumeGroup.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
- volumeGroup.setModelCustomizationName(modelCustomizationName);
- return volumeGroup;
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.model;
+
+import org.onap.vid.asdc.beans.tosca.Group;
+
+/**
+ * The Class VolumeGroup.
+ */
+public class VolumeGroup {
+
+ /** The uuid. */
+ private String uuid;
+
+ /** The invariant uuid. */
+ private String invariantUuid;
+
+ /** The description. */
+ private String description;
+
+ /** The name. */
+ private String name;
+
+ /** The version. */
+ private String version;
+
+ /** The customization uuid. */
+ private String customizationUuid;
+
+ /** The customization uuid. */
+ private String modelCustomizationName;
+ /**
+ * Instantiates a new volume group.
+ */
+ public VolumeGroup() {}
+
+ /**
+ * Gets the uuid.
+ *
+ * @return the uuid
+ */
+ public String getUuid() {
+ return uuid;
+ }
+ /**
+ * Gets the customization uuid.
+ *
+ * @return the customization uuid
+ */
+ public String getCustomizationUuid() {
+ return customizationUuid;
+ }
+ /**
+ * Gets the customization name.
+ *
+ * @return the customization name
+ */
+ public String getModelCustomizationName() {
+ return modelCustomizationName;
+ }
+ /**
+ * Gets the invariant uuid.
+ *
+ * @return the invariant uuid
+ */
+ public String getInvariantUuid() {
+ return invariantUuid;
+ }
+
+ /**
+ * Gets the description.
+ *
+ * @return the description
+ */
+ public String getDescription() {
+ return description;
+ }
+
+ /**
+ * Gets the name.
+ *
+ * @return the name
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Gets the version.
+ *
+ * @return the version
+ */
+ public String getVersion() {
+ return version;
+ }
+
+ /**
+ * Sets the uuid.
+ *
+ * @param uuid the new uuid
+ */
+ public void setUuid(String uuid) {
+ this.uuid = uuid;
+ }
+
+ /**
+ * Sets the invariant uuid.
+ *
+ * @param invariantUuid the new invariant uuid
+ */
+ public void setInvariantUuid(String invariantUuid) {
+ this.invariantUuid = invariantUuid;
+ }
+
+ /**
+ * Sets the description.
+ *
+ * @param description the new description
+ */
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ /**
+ * Sets the name.
+ *
+ * @param name the new name
+ */
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Sets the version.
+ *
+ * @param version the new version
+ */
+ public void setVersion(String version) {
+ this.version = version;
+ }
+ /**
+ * Sets the customization uuid.
+ *
+ * @param u the new customization uuid
+ */
+ public void setCustomizationUuid(String u) {
+ this.customizationUuid = u;
+
+ }
+ /**
+ * Sets the customization name.
+ *
+ * @param u the new customization name
+ */
+ public void setModelCustomizationName(String u) {
+ this.modelCustomizationName = u;
+
+ }
+ /**
+ * Extract volume group.
+ *
+ * @param group the group
+ * @return the volume group
+ */
+ public static VolumeGroup extractVolumeGroup(String modelCustomizationName, Group group) {
+ final VolumeGroup volumeGroup = new VolumeGroup();
+
+ volumeGroup.setUuid(group.getMetadata().getVfModuleModelUUID());
+ volumeGroup.setInvariantUuid(group.getMetadata().getVfModuleModelInvariantUUID());
+ volumeGroup.setDescription(group.getMetadata().getDescription());
+ volumeGroup.setName(group.getMetadata().getVfModuleModelName());
+ volumeGroup.setVersion(group.getMetadata().getVfModuleModelVersion());
+ volumeGroup.setCustomizationUuid(group.getMetadata().getVfModuleModelCustomizationUUID());
+ volumeGroup.setModelCustomizationName(modelCustomizationName);
+ return volumeGroup;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java b/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
index 6032ec5aa..346138dc0 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/Workflow.java
+++ b/vid-app-common/src/main/java/org/onap/vid/model/Workflow.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.model;
+package org.onap.vid.model;
import java.util.Collection;
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
new file mode 100644
index 000000000..c197299ff
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogic.java
@@ -0,0 +1,99 @@
+package org.onap.vid.mso;
+
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.controller.OperationalEnvironmentController;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.Task;
+
+import java.util.List;
+
+public interface MsoBusinessLogic {
+
+ // this function should get params from tosca and send them to instance at mso, then return success response.
+ MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception;
+
+ MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+ MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+ MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+ MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+ MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception;
+
+ MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String volumeGroupId)throws Exception;
+
+ MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String serviceInstanceId, String networkInstanceId) throws Exception;
+
+ MsoResponseWrapper getOrchestrationRequest(String requestId)throws Exception;
+
+ MsoResponseWrapper getOrchestrationRequests(String filterString)throws Exception;
+
+ List<Request> getOrchestrationRequestsForDashboard()throws Exception;
+
+ List<Task> getManualTasksByRequestId(String originalRequestId)throws Exception;
+
+ MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String taskId)throws Exception;
+
+ MsoResponseWrapper activateServiceInstance(RequestDetails requestDetails, String serviceInstanceId)throws Exception;
+
+ MsoResponseWrapperInterface updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapperInterface replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapperInterface updateVnfSoftware(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapperInterface updateVnfConfig(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception;
+
+ MsoResponseWrapper deleteConfiguration(
+ RequestDetails requestDetails,
+ String serviceInstanceId,
+ String configurationId) throws Exception;
+
+ MsoResponseWrapper setConfigurationActiveStatus(
+ RequestDetails requestDetails,
+ String serviceInstanceId,
+ String configurationId,
+ boolean isActivate) throws Exception;
+
+ MsoResponseWrapper setPortOnConfigurationStatus(
+ RequestDetails requestDetails,
+ String serviceInstanceId,
+ String configurationId,
+ boolean isEnable) throws Exception;
+
+ RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentActivationRequestDetails(OperationalEnvironmentActivateInfo details);
+
+ String getOperationalEnvironmentActivationPath(OperationalEnvironmentActivateInfo details);
+
+ RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentDeactivationRequestDetails(OperationalEnvironmentDeactivateInfo details);
+
+ String getCloudResourcesRequestsStatusPath(String requestId);
+
+ String getOperationalEnvironmentDeactivationPath(OperationalEnvironmentDeactivateInfo details);
+
+ String getOperationalEnvironmentCreationPath();
+
+ RequestDetailsWrapper<OperationEnvironmentRequestDetails> convertParametersToRequestDetails(OperationalEnvironmentController.OperationalEnvironmentCreateBody input, String userId);
+
+ MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+ MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception;
+
+ MsoResponseWrapper setServiceInstanceStatus(RequestDetails requestDetails , String serviceInstanceId, boolean isActivate)throws Exception;
+
+ RequestDetailsWrapper generateInPlaceMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception;
+
+ RequestDetailsWrapper generateConfigMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
new file mode 100644
index 000000000..6ad6b5fd0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoBusinessLogicImpl.java
@@ -0,0 +1,800 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.DeserializationFeature;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.SerializationFeature;
+import com.google.common.collect.ImmutableList;
+import com.google.common.collect.ImmutableMap;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.changeManagement.ChangeManagementRequest;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.controller.OperationalEnvironmentController;
+import org.onap.vid.domain.mso.RequestInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentActivateInfo;
+import org.onap.vid.mso.model.OperationalEnvironmentDeactivateInfo;
+import org.onap.vid.mso.rest.OperationalEnvironment.OperationEnvironmentRequestDetails;
+import org.onap.vid.mso.rest.*;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.ws.rs.BadRequestException;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.*;
+import java.util.regex.Pattern;
+
+import static org.onap.vid.changeManagement.ChangeManagementRequest.MsoChangeManagementRequest;
+import static org.onap.vid.controller.MsoController.*;
+import static org.onap.vid.mso.MsoProperties.*;
+
+public class MsoBusinessLogicImpl implements MsoBusinessLogic {
+
+ /**
+ * The Constant dateFormat.
+ */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+ final static Pattern SOFTWARE_VERSION_PATTERN = Pattern.compile("^[A-Za-z0-9.\\-]+$");
+ final static Pattern NUMBER_PATTERN = Pattern.compile("^[0-9]+$");
+ private static final String ACTIVATE = "/activate";
+ private static final String DEACTIVATE = "/deactivate";
+ private static final String ENABLE_PORT = "/enablePort";
+ private static final String DISABLE_PORT = "/disablePort";
+ private final static String RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT = "operationalEnvironment";
+ private final static String SOURCE_OPERATIONAL_ENVIRONMENT = "VID";
+ final static private ObjectMapper objectMapper = new ObjectMapper();
+ /**
+ * The Mso REST client
+ * This should be replaced with mso client factory.
+ */
+ private final MsoInterface msoClientInterface;
+ /**
+ * The logger.
+ */
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoBusinessLogicImpl.class);
+
+ @Autowired
+ public MsoBusinessLogicImpl(MsoInterface msoClientInterface) {
+ this.msoClientInterface = msoClientInterface;
+ }
+
+ static String validateEndpointPath(String endpointEnvVariable) {
+ String endpoint = SystemProperties.getProperty(endpointEnvVariable);
+ if (endpoint == null || endpoint.isEmpty()) {
+ throw new RuntimeException(endpointEnvVariable + " env variable is not defined");
+ }
+ return endpoint;
+ }
+
+ // this function should get params from tosca and send them to instance at mso, then return success response.
+ @Override
+ public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
+ String methodName = "createSvcInstance ";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ return msoClientInterface.createSvcInstance(msoRequest, endpoint);
+ }
+
+ void validateLineOfBusiness(RequestDetails requestDetails) {
+
+ Object value = requestDetails.getAdditionalProperties();
+
+ for(String prop: ImmutableList.of("requestDetails", "lineOfBusiness", "lineOfBusinessName")) {
+ if(value==null ||!(value instanceof Map)) {
+ value = null;
+ break;
+ }
+ else {
+ value = ((Map)value).get(prop);
+ }
+ }
+
+ if(value == null || value.toString().isEmpty()) {
+ throw new BadRequestException("lineOfBusiness is required");
+ }
+
+ }
+
+ @Override
+ public MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "createVnf";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ return msoClientInterface.createVnf(requestDetails, vnf_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "createNwInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String nw_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ return msoClientInterface.createNwInstance(requestDetails, nw_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "createVolumeGroupInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ vnf_endpoint = vnf_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+ return msoClientInterface.createVolumeGroupInstance(requestDetails, vnf_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "createVfModuleInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String partial_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ String vf_module_endpoint = partial_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+ return msoClientInterface.createVfModuleInstance(requestDetails, vf_module_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "createConfigurationInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATIONS);
+ endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+
+ return msoClientInterface.createConfigurationInstance(requestDetails, endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "deleteSvcInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String svc_endpoint = endpoint + "/" + serviceInstanceId;
+
+ return msoClientInterface.deleteSvcInstance(requestDetails, svc_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "deleteVnf";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+ String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
+
+ return msoClientInterface.deleteVnf(requestDetails, vnf_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception {
+ String methodName = "deleteVfModule";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String vf__modules_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId).replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+
+ String delete_vf_endpoint = vf__modules_endpoint + '/' + vfModuleId;
+
+ return msoClientInterface.deleteVfModule(requestDetails, delete_vf_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String volumeGroupId) throws Exception {
+ String methodName = "deleteVolumeGroupInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ String vnf_endpoint = svc_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
+ String delete_volume_group_endpoint = vnf_endpoint + "/" + volumeGroupId;
+
+ return msoClientInterface.deleteVolumeGroupInstance(requestDetails, delete_volume_group_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String serviceInstanceId, String networkInstanceId) throws Exception {
+ String methodName = "deleteNwInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+
+ String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ String delete_nw_endpoint = svc_endpoint + "/" + networkInstanceId;
+
+ return msoClientInterface.deleteNwInstance(requestDetails, delete_nw_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper getOrchestrationRequest(String requestId) throws Exception {
+ String methodName = "getOrchestrationRequest";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ MsoResponseWrapper w = null;
+ try {
+ String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQ);
+ String path = p + "/" + requestId;
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+
+ msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public MsoResponseWrapper getOrchestrationRequests(String filterString) throws Exception {
+ String methodName = "getOrchestrationRequest";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ MsoResponseWrapper w = null;
+ try {
+ String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
+ String path = p + filterString;
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+
+ msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public List<Request> getOrchestrationRequestsForDashboard() throws Exception {
+ String methodName = "getOrchestrationRequestsForDashboard";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ List<Request> filteredOrchestrationRequests = new ArrayList<>();
+ try {
+ String path = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
+ path += "filter=modelType:EQUALS:vnf";
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+
+ MsoResponseWrapper msoResponseWrapper = msoClientInterface.getOrchestrationRequestsForDashboard(str, "", path, restObjStr);
+ List<RequestWrapper> allOrchestrationRequests = deserializeOrchestrationRequestsJson(msoResponseWrapper.getEntity());
+
+ ;
+ for (RequestWrapper currentRequest : allOrchestrationRequests) {
+ if ((currentRequest.getRequest() != null) && (currentRequest.getRequest().getRequestScope() == Request.RequestScope.VNF) && ((currentRequest.getRequest().getRequestType() ==
+ Request.RequestType.REPLACE_INSTANCE) || (currentRequest.getRequest().getRequestType() ==
+ Request.RequestType.UPDATE_INSTANCE))) {
+ filteredOrchestrationRequests.add(currentRequest.getRequest());
+ }
+ }
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ }
+ return filteredOrchestrationRequests;
+
+ }
+
+ private List<RequestWrapper> deserializeOrchestrationRequestsJson(String orchestrationRequestsJson) throws Exception {
+ String methodName = "deserializeOrchestrationRequestsJson";
+ logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ ObjectMapper mapper = new ObjectMapper();
+ mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
+ mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
+ RequestList requestList = mapper.readValue(orchestrationRequestsJson, RequestList.class);
+ return requestList.getRequestList();
+ }
+
+
+ @Override
+ public List<Task> getManualTasksByRequestId(String originalRequestId) throws Exception {
+ String methodName = "getManualTasksByRequestId";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ try {
+ String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
+ String path = p + "?originalRequestId=" + originalRequestId;
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+
+ MsoResponseWrapper msoResponseWrapper = msoClientInterface.getManualTasksByRequestId(str, "", path, restObjStr);
+ return deserializeManualTasksJson(msoResponseWrapper.getEntity());
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ private List<Task> deserializeManualTasksJson(String manualTasksJson) throws Exception {
+ String methodName = "deserializeManualTasksJson";
+ logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ ObjectMapper mapper = new ObjectMapper();
+ TaskList taskList = mapper.readValue(manualTasksJson, TaskList.class);
+ return taskList.getTaskList();
+ }
+
+
+ @Override
+ public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String taskId) throws Exception {
+ String methodName = "completeManualTask";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ MsoResponseWrapper w = null;
+ try {
+ String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
+ String path = p + "/" + taskId + "/complete";
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+
+ msoClientInterface.completeManualTask(requestDetails, str, "", path, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public MsoResponseWrapper activateServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "activateServiceInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ try {
+ String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String activateServicePath = serviceEndpoint + "/" + serviceInstanceId + "/activate";
+
+ RestObject<String> restObjStr = new RestObject<>();
+ String str = "";
+ restObjStr.set(str);
+
+ msoClientInterface.setServiceInstanceStatus(requestDetails, str, "", activateServicePath, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+
+ @Override
+ public MsoResponseWrapperInterface updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "updateVnf";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+ String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
+ return msoClientInterface.updateVnf(requestDetails, vnf_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapperInterface replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "replaceVnf";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint;
+ try {
+ endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE);
+ } catch (Exception exception) {
+ throw exception;
+ }
+ String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ vnf_endpoint = vnf_endpoint.replace(VNF_INSTANCE_ID, vnfInstanceId);
+ vnf_endpoint = vnf_endpoint.replace(REQUEST_TYPE, MsoChangeManagementRequest.REPLACE);
+ return msoClientInterface.replaceVnf(requestDetails, vnf_endpoint);
+ }
+
+ public RequestDetailsWrapper generateInPlaceMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception {
+ validateUpdateVnfSoftwarePayload(requestDetails);
+ RequestDetails inPlaceSoftwareUpdateRequest = new RequestDetails();
+ inPlaceSoftwareUpdateRequest.setCloudConfiguration(requestDetails.getCloudConfiguration());
+ inPlaceSoftwareUpdateRequest.setRequestParameters(requestDetails.getRequestParameters());
+ inPlaceSoftwareUpdateRequest.setRequestInfo(requestDetails.getRequestInfo());
+ RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+ requestDetailsWrapper.requestDetails = inPlaceSoftwareUpdateRequest;
+ return requestDetailsWrapper;
+ }
+
+ @Override
+ public RequestDetailsWrapper generateConfigMsoRequest(org.onap.vid.changeManagement.RequestDetails requestDetails) throws Exception {
+ validateUpdateVnfConfig(requestDetails);
+ RequestDetails ConfigUpdateRequest = new RequestDetails();
+ ConfigUpdateRequest.setRequestParameters(requestDetails.getRequestParameters());
+ ConfigUpdateRequest.setRequestInfo(requestDetails.getRequestInfo());
+ RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
+ requestDetailsWrapper.requestDetails = ConfigUpdateRequest;
+ return requestDetailsWrapper;
+ }
+
+ @Override
+ public MsoResponseWrapperInterface updateVnfSoftware(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "updateVnfSoftware";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ String vnf_endpoint = getChangeManagementEndpoint(serviceInstanceId, vnfInstanceId, MsoChangeManagementRequest.SOFTWARE_UPDATE); //workflow name in mso is different than workflow name in vid UI
+ RequestDetailsWrapper finalRequestDetails = generateInPlaceMsoRequest(requestDetails);
+ return msoClientInterface.changeManagementUpdate(finalRequestDetails, vnf_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapperInterface updateVnfConfig(org.onap.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
+ String methodName = "updateVnfConfig";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ RequestDetailsWrapper finalRequestDetails = generateConfigMsoRequest(requestDetails);
+ String vnf_endpoint = getChangeManagementEndpoint(serviceInstanceId, vnfInstanceId, MsoChangeManagementRequest.CONFIG_UPDATE);
+ return msoClientInterface.changeManagementUpdate(finalRequestDetails, vnf_endpoint);
+ }
+
+ private String getChangeManagementEndpoint(String serviceInstanceId, String vnfInstanceId, String vnfRequestType) {
+ String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE);
+ String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
+ vnf_endpoint = vnf_endpoint.replace(VNF_INSTANCE_ID, vnfInstanceId);
+ vnf_endpoint = vnf_endpoint.replace(REQUEST_TYPE, vnfRequestType);
+ return vnf_endpoint;
+ }
+
+ private Map getChangeManagementPayload(RequestDetails requestDetails, String message) throws Exception{
+ if(requestDetails.getRequestParameters()==null||requestDetails.getRequestParameters().getAdditionalProperties()==null){
+ throw new BadRequestException(message);
+ }
+ Object payloadRaw=requestDetails.getRequestParameters().getAdditionalProperties().get("payload");
+ try{
+ return objectMapper.readValue((String)payloadRaw,Map.class);
+ }
+ catch(Exception exception){
+ throw new BadRequestException(message);
+ }
+ }
+
+ private void validateUpdateVnfSoftwarePayload(RequestDetails requestDetails) throws Exception {
+ final String noValidPayloadMsg = "No valid payload in " + ChangeManagementRequest.VNF_IN_PLACE_SOFTWARE_UPDATE + " request";
+
+ Map payload = getChangeManagementPayload(requestDetails, noValidPayloadMsg);
+ validateUpdateVnfSoftwarePayloadProperty(payload, noValidPayloadMsg, "existing-software-version", SOFTWARE_VERSION_PATTERN);
+ validateUpdateVnfSoftwarePayloadProperty(payload, noValidPayloadMsg, "new-software-version", SOFTWARE_VERSION_PATTERN);
+
+ //if "operations-timeout" is not integer, trying to read it as String that represent a number
+ if (!(payload.get("operations-timeout") instanceof Integer)) {
+ validateUpdateVnfSoftwarePayloadProperty(payload, noValidPayloadMsg, "operations-timeout", NUMBER_PATTERN);
+ }
+
+ }
+
+ private void validateUpdateVnfSoftwarePayloadProperty(Map payload, String noValidPayloadMsg, String propertyName, Pattern pattern) {
+ Object forValidation = payload.get(propertyName);
+ final String noValidPayloadPropertyMsg = noValidPayloadMsg + ", " + propertyName + " property is not valid";
+ if (!(forValidation instanceof String)) {
+ throw new BadRequestException(noValidPayloadPropertyMsg);
+ }
+ if (!pattern.matcher((String) forValidation).matches()) {
+ throw new BadRequestException(noValidPayloadPropertyMsg);
+ }
+ }
+
+ private void validateUpdateVnfConfig(RequestDetails requestDetails) throws Exception {
+ final String noValidPayloadMsg = "No valid payload in " + ChangeManagementRequest.CONFIG_UPDATE + " request";
+
+ Map payload = getChangeManagementPayload(requestDetails, noValidPayloadMsg);
+ validateConfigUpdateVnfPayloadProperty(payload, noValidPayloadMsg, "request-parameters");
+ validateConfigUpdateVnfPayloadProperty(payload, noValidPayloadMsg, "configuration-parameters");
+ }
+
+ private void validateConfigUpdateVnfPayloadProperty(Map payload, String noValidPayloadMsg, String propertyName) {
+ Object forValidation = payload.get(propertyName);
+ final String noValidPayloadPropertyMsg = noValidPayloadMsg+ ", "+ propertyName + " property is not valid";
+ if(!payload.containsKey(propertyName)) {
+ throw new BadRequestException( noValidPayloadPropertyMsg);
+ }
+ }
+
+ @Override
+ public MsoResponseWrapper deleteConfiguration(
+ RequestDetails requestDetails,
+ String serviceInstanceId,
+ String configurationId) throws Exception {
+
+ String methodName = "deleteConfiguration";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATION_INSTANCE);
+ endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+ endpoint = endpoint.replace(CONFIGURATION_ID, configurationId);
+
+ return msoClientInterface.deleteConfiguration(requestDetails, endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper setConfigurationActiveStatus(
+ RequestDetails requestDetails,
+ String serviceInstanceId,
+ String configurationId,
+ boolean isActivate) throws Exception {
+
+ String methodName = "setConfigurationActiveStatus";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATION_INSTANCE);
+ endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+ endpoint = endpoint.replace(CONFIGURATION_ID, configurationId);
+
+ String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE);
+ endpoint = endpoint + isActivateState;
+
+ return msoClientInterface.setConfigurationActiveStatus(requestDetails, endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper setServiceInstanceStatus(RequestDetails requestDetails , String serviceInstanceId, boolean isActivate)throws Exception{
+ String methodName = "setServiceInstanceStatus";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+ try {
+ String serviceEndpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String endpoint = serviceEndpoint + "/" + serviceInstanceId;
+
+ String isActivateState = (isActivate ? ACTIVATE : DEACTIVATE);
+ endpoint = endpoint + isActivateState;
+
+
+ RestObject<String> restObjStr = new RestObject<>();
+ String str = "";
+ restObjStr.set(str);
+
+ msoClientInterface.setServiceInstanceStatus(requestDetails , str, "", endpoint, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+
+ } catch (Exception e) {
+ logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public MsoResponseWrapper setPortOnConfigurationStatus(
+ RequestDetails requestDetails,
+ String serviceInstanceId,
+ String configurationId,
+ boolean isEnable) throws Exception {
+ String methodName = "setPortOnConfigurationStatus";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_CONFIGURATION_INSTANCE);
+ endpoint = endpoint.replace(SVC_INSTANCE_ID, serviceInstanceId);
+ endpoint = endpoint.replace(CONFIGURATION_ID, configurationId);
+
+ String isEnablePortStatus = (isEnable ? ENABLE_PORT : DISABLE_PORT);
+ endpoint = endpoint + isEnablePortStatus;
+
+ return msoClientInterface.setPortOnConfigurationStatus(requestDetails, endpoint);
+ }
+
+
+ @Override
+ public RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentActivationRequestDetails(OperationalEnvironmentActivateInfo details) {
+ RequestDetails requestDetails = new RequestDetails();
+ RequestInfo requestInfo = new RequestInfo();
+ requestInfo.setAdditionalProperty("resourceType", RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT);
+ requestInfo.setSource(SOURCE_OPERATIONAL_ENVIRONMENT);
+ requestInfo.setRequestorId(details.getUserId());
+ requestDetails.setRequestInfo(requestInfo);
+
+ org.onap.vid.domain.mso.RelatedInstance relatedInstance = new org.onap.vid.domain.mso.RelatedInstance();
+ relatedInstance.setAdditionalProperty("resourceType", RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT);
+ relatedInstance.setInstanceId(details.getRelatedInstanceId());
+ relatedInstance.setInstanceName(details.getRelatedInstanceName());
+ requestDetails.setAdditionalProperty("relatedInstanceList", Collections.singletonList(ImmutableMap.of("relatedInstance", relatedInstance)));
+
+ org.onap.vid.domain.mso.RequestParameters requestParameters = new org.onap.vid.domain.mso.RequestParameters();
+ requestParameters.setUserParams(null);
+ requestParameters.setAdditionalProperty("operationalEnvironmentType", "VNF");
+ requestParameters.setAdditionalProperty("workloadContext", details.getWorkloadContext());
+ requestParameters.setAdditionalProperty("manifest", details.getManifest());
+ requestDetails.setRequestParameters(requestParameters);
+
+ RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = new RequestDetailsWrapper<>(requestDetails);
+
+ debugRequestDetails(requestDetailsWrapper);
+
+ return requestDetailsWrapper;
+ }
+
+ @Override
+ public String getOperationalEnvironmentActivationPath(OperationalEnvironmentActivateInfo details) {
+ String path = validateEndpointPath(MSO_REST_API_OPERATIONAL_ENVIRONMENT_ACTIVATE);
+ path = path.replace("<operational_environment_id>", details.getOperationalEnvironmentId());
+ return path;
+ }
+
+ @Override
+ public RequestDetailsWrapper<RequestDetails> createOperationalEnvironmentDeactivationRequestDetails(OperationalEnvironmentDeactivateInfo details) {
+ RequestDetails requestDetails = new RequestDetails();
+
+ RequestInfo requestInfo = new RequestInfo();
+ requestInfo.setAdditionalProperty("resourceType", RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT);
+ requestInfo.setSource(SOURCE_OPERATIONAL_ENVIRONMENT);
+ requestInfo.setRequestorId(details.getUserId());
+ requestDetails.setRequestInfo(requestInfo);
+
+ org.onap.vid.domain.mso.RequestParameters requestParameters = new org.onap.vid.domain.mso.RequestParameters();
+ requestParameters.setUserParams(null);
+ requestParameters.setAdditionalProperty("operationalEnvironmentType", "VNF");
+ requestDetails.setRequestParameters(requestParameters);
+ RequestDetailsWrapper<RequestDetails> requestDetailsWrapper = new RequestDetailsWrapper<>(requestDetails);
+ debugRequestDetails(requestDetailsWrapper);
+ return requestDetailsWrapper;
+ }
+
+ @Override
+ public String getCloudResourcesRequestsStatusPath(String requestId) {
+ String path = validateEndpointPath(MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS);
+ path = path.replace("<request_id>", requestId);
+ return path;
+ }
+
+ @Override
+ public String getOperationalEnvironmentDeactivationPath(OperationalEnvironmentDeactivateInfo details) {
+ String path = validateEndpointPath(MSO_REST_API_OPERATIONAL_ENVIRONMENT_DEACTIVATE);
+ path = path.replace("<operational_environment_id>", details.getOperationalEnvironmentId());
+ return path;
+ }
+
+ private void debugRequestDetails(Object requestDetails) {
+ if (logger.isDebugEnabled()) {
+ String requestDetailsAsString;
+ try {
+ requestDetailsAsString = new ObjectMapper().enable(SerializationFeature.INDENT_OUTPUT).writeValueAsString(requestDetails);
+ } catch (JsonProcessingException e) {
+ requestDetailsAsString = "error: cannot stringify RequestDetails";
+ }
+ logger.debug(EELFLoggerDelegate.debugLogger, "requestDetailsAsString: {}", requestDetailsAsString);
+ }
+ }
+
+ @Override
+ public String getOperationalEnvironmentCreationPath() {
+ String path = validateEndpointPath(MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE);
+ return path;
+ }
+
+ @Override
+ public RequestDetailsWrapper<OperationEnvironmentRequestDetails> convertParametersToRequestDetails(OperationalEnvironmentController.OperationalEnvironmentCreateBody input, String userId) {
+ OperationEnvironmentRequestDetails.RequestInfo requestInfo = new OperationEnvironmentRequestDetails.RequestInfo(
+ RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT,
+ input.getInstanceName(),
+ SOURCE_OPERATIONAL_ENVIRONMENT,
+ userId);
+
+ OperationEnvironmentRequestDetails.RelatedInstance relatedInstance = new OperationEnvironmentRequestDetails.RelatedInstance(
+ RESOURCE_TYPE_OPERATIONAL_ENVIRONMENT,
+ input.getEcompInstanceId(),
+ input.getEcompInstanceName());
+
+ List<OperationEnvironmentRequestDetails.RelatedInstance> relatedInstanceList = Collections.singletonList((relatedInstance));
+
+ OperationEnvironmentRequestDetails.RequestParameters requestParameters = new OperationEnvironmentRequestDetails.RequestParameters(
+ input.getOperationalEnvironmentType(),
+ input.getTenantContext(),
+ input.getWorkloadContext());
+
+ OperationEnvironmentRequestDetails requestDetails = new OperationEnvironmentRequestDetails(requestInfo, relatedInstanceList, requestParameters);
+ RequestDetailsWrapper<OperationEnvironmentRequestDetails> requestDetailsWrapper = new RequestDetailsWrapper<>(requestDetails);
+ debugRequestDetails(requestDetailsWrapper);
+ return requestDetailsWrapper;
+ }
+
+ @Override
+ public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "removeRelationshipFromServiceInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String removeRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/removeRelationships";
+
+ return msoClientInterface.removeRelationshipFromServiceInstance(requestDetails, removeRelationshipsPath);
+ }
+
+ @Override
+ public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
+ String methodName = "addRelationshipToServiceInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ String serviceEndpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
+ String addRelationshipsPath = serviceEndpoint + "/" + serviceInstanceId + "/addRelationships";
+
+ return msoClientInterface.addRelationshipToServiceInstance(requestDetails, addRelationshipsPath);
+ }
+
+
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
index cdeb1bbd2..2d09630f0 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoInterface.java
@@ -1,10 +1,7 @@
-package org.openecomp.vid.mso;
+package org.onap.vid.mso;
-import org.openecomp.vid.mso.rest.Request;
-import org.openecomp.vid.mso.rest.RequestDetails;
-import org.openecomp.vid.mso.rest.Task;
-
-import java.util.List;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.mso.rest.RequestDetails;
/**
* Created by pickjonathan on 21/06/2017.
@@ -47,6 +44,8 @@ public interface MsoInterface {
*/
MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+ MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception;
MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception;
@@ -65,11 +64,22 @@ public interface MsoInterface {
MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception;
- MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint) throws Exception;
+ MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint) throws Exception;
+
+ MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint) throws Exception;
+
+ MsoResponseWrapper deleteConfiguration(RequestDetails requestDetails, String pmc_endpoint) throws Exception;
- MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint) throws Exception;
+ MsoResponseWrapper setConfigurationActiveStatus(RequestDetails requestDetails, String endpoint) throws Exception;
+ MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails requestDetails, String endpoint) throws Exception;
- void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception;
+ void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception;
+ MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint) throws Exception;
+
+ MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint) throws Exception;
+
+ MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath) throws Exception;
}
+
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
index 0eed0e1d1..607d84194 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoProperties.java
@@ -1,105 +1,119 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-/**
- * The Class MsoProperties.
- */
-public class MsoProperties extends SystemProperties {
-
- /** The Constant MSO_SERVER_URL. */
- //VID Properties related to MSO
- public static final String MSO_SERVER_URL = "mso.server.url";
-
- /** The Constant MSO_DME2_SERVER_URL. */
- public static final String MSO_DME2_SERVER_URL = "mso.dme2.server.url";
-
- /** The Constant MSO_DME2_CLIENT_TIMEOUT. */
- public static final String MSO_DME2_CLIENT_TIMEOUT = "mso.dme2.client.timeout";
-
- /** The Constant MSO_DME2_CLIENT_READ_TIMEOUT. */
- public static final String MSO_DME2_CLIENT_READ_TIMEOUT = "mso.dme2.client.read.timeout";
-
- /** The Constant MSO_SERVER_URL_DEFAULT. */
- public static final String MSO_SERVER_URL_DEFAULT= "";
-
- /** The Constant MSO_POLLING_INTERVAL_MSECS. */
- // number of msecs to wait between polling requests
- public static final String MSO_POLLING_INTERVAL_MSECS = "mso.polling.interval.msecs";
-
- /** The Constant MSO_POLLING_INTERVAL_MSECS_DEFAULT. */
- public static final String MSO_POLLING_INTERVAL_MSECS_DEFAULT = "60000";
-
- /** The Constant MSO_DME2_ENABLED. */
- public static final String MSO_DME2_ENABLED = "mso.dme2.enabled";
-
- /** The Constant MSO_MAX_POLLS. */
- public static final String MSO_MAX_POLLS = "mso.max.polls";
-
- /** The Constant MSO_MAX_POLLS_DEFAULT. */
- public static final String MSO_MAX_POLLS_DEFAULT = "10"; //10
-
- /** The Constant MSO_USER_NAME. */
- public static final String MSO_USER_NAME = "mso.user.name"; //m03346
-
- /** The Constant MSO_PASSWORD. */
- public static final String MSO_PASSWORD = "mso.password.x";
-
- /** The Constant MSO_REST_API_SVC_INSTANCE. */
- public static final String MSO_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance"; // /serviceInstances/v2
-
- /** The Constant MSO_REST_API_VNF_INSTANCE. */
- public static final String MSO_REST_API_VNF_INSTANCE = "mso.restapi.vnf.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs
-
- /** The Constant MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE. */
- public static final String MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE = "mso.restapi.vnf.changemanagement.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs/{request_type}
-
- /** The Constant MSO_REST_API_NETWORK_INSTANCE. */
- public static final String MSO_REST_API_NETWORK_INSTANCE = "mso.restapi.network.instance"; // /serviceInstances/v2/{serviceInstanceId}/networks
-
- /** The Constant MSO_REST_API_GET_ORC_REQ. */
- public static final String MSO_REST_API_GET_ORC_REQ = "mso.restapi.get.orc.req";
-
- /** The Constant MSO_REST_API_GET_ORC_REQS. */
- public static final String MSO_REST_API_GET_ORC_REQS = "mso.restapi.get.orc.reqs";
-
- /** The Constant MSO_REST_API_GET_MAN_TASK. */
- public static final String MSO_REST_API_GET_MAN_TASKS = "mso.restapi.get.man.tasks";
-
- /** The Constant MSO_REST_API_VF_MODULE_INSTANCE. */
- public static final String MSO_REST_API_VF_MODULE_INSTANCE = "mso.restapi.vf.module.instance";
-
- /** The Constant MSO_REST_API_VOLUME_GROUP_INSTANCE. */
- public static final String MSO_REST_API_VOLUME_GROUP_INSTANCE = "mso.restapi.volume.group.instance"; //serviceInstances/v2/{serviceInstanceId}/volumeGroups
-
- /** The logger. */
- public EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoProperties.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+/**
+ * The Class MsoProperties.
+ */
+public class MsoProperties extends SystemProperties {
+
+ /** The Constant MSO_SERVER_URL. */
+ //VID Properties related to MSO
+ public static final String MSO_SERVER_URL = "mso.server.url";
+
+ /** The Constant MSO_DME2_SERVER_URL. */
+ public static final String MSO_DME2_SERVER_URL = "mso.dme2.server.url";
+
+ /** The Constant MSO_DME2_CLIENT_TIMEOUT. */
+ public static final String MSO_DME2_CLIENT_TIMEOUT = "mso.dme2.client.timeout";
+
+ /** The Constant MSO_DME2_CLIENT_READ_TIMEOUT. */
+ public static final String MSO_DME2_CLIENT_READ_TIMEOUT = "mso.dme2.client.read.timeout";
+
+ /** The Constant MSO_SERVER_URL_DEFAULT. */
+ public static final String MSO_SERVER_URL_DEFAULT= "";
+
+ /** The Constant MSO_POLLING_INTERVAL_MSECS. */
+ // number of msecs to wait between polling requests
+ public static final String MSO_POLLING_INTERVAL_MSECS = "mso.polling.interval.msecs";
+
+ /** The Constant MSO_POLLING_INTERVAL_MSECS_DEFAULT. */
+ public static final String MSO_POLLING_INTERVAL_MSECS_DEFAULT = "60000";
+
+ /** The Constant MSO_DME2_ENABLED. */
+ public static final String MSO_DME2_ENABLED = "mso.dme2.enabled";
+
+ /** The Constant MSO_MAX_POLLS. */
+ public static final String MSO_MAX_POLLS = "mso.max.polls";
+
+ /** The Constant MSO_MAX_POLLS_DEFAULT. */
+ public static final String MSO_MAX_POLLS_DEFAULT = "10"; //10
+
+ /** The Constant MSO_USER_NAME. */
+ public static final String MSO_USER_NAME = "mso.user.name"; //m03346
+
+ /** The Constant MSO_PASSWORD. */
+ public static final String MSO_PASSWORD = "mso.password.x";
+
+ /** The Constant MSO_REST_API_SVC_INSTANCE. */
+ public static final String MSO_REST_API_SVC_INSTANCE = "mso.restapi.svc.instance"; // /serviceInstances/v2
+
+ /** The Constant MSO_REST_API_VNF_INSTANCE. */
+ public static final String MSO_REST_API_VNF_INSTANCE = "mso.restapi.vnf.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs
+
+ /** The Constant MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE. */
+ public static final String MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE = "mso.restapi.vnf.changemanagement.instance"; // /serviceInstances/v2/{service_instance_id}/vnfs/{request_type}
+
+ /** The Constant MSO_REST_API_NETWORK_INSTANCE. */
+ public static final String MSO_REST_API_NETWORK_INSTANCE = "mso.restapi.network.instance"; // /serviceInstances/v2/{serviceInstanceId}/networks
+
+ /** The Constant MSO_REST_API_GET_ORC_REQ. */
+ public static final String MSO_REST_API_GET_ORC_REQ = "mso.restapi.get.orc.req";
+
+ /** The Constant MSO_REST_API_GET_ORC_REQS. */
+ public static final String MSO_REST_API_GET_ORC_REQS = "mso.restapi.get.orc.reqs";
+
+ /** The Constant MSO_REST_API_GET_MAN_TASK. */
+ public static final String MSO_REST_API_GET_MAN_TASKS = "mso.restapi.get.man.tasks";
+
+ /** The Constant MSO_REST_API_VF_MODULE_INSTANCE. */
+ public static final String MSO_REST_API_VF_MODULE_INSTANCE = "mso.restapi.vf.module.instance";
+
+ /** The Constant MSO_REST_API_VOLUME_GROUP_INSTANCE. */
+ public static final String MSO_REST_API_VOLUME_GROUP_INSTANCE = "mso.restapi.volume.group.instance"; //serviceInstances/v2/{serviceInstanceId}/volumeGroups
+
+ /** The Constant MSO_REST_API_CONFIGURATION_INSTANCE. */
+ public static final String MSO_REST_API_CONFIGURATIONS = "mso.restapi.configurations"; //serviceInstances/v5/{serviceInstanceId}/configurations/
+ public static final String MSO_REST_API_CONFIGURATION_INSTANCE = "mso.restapi.configuration.instance"; //serviceInstances/v5/{serviceInstanceId}/configurations/{configurationId}
+
+ /** The Constant MSO_REST_API_OPERATIONAL_ENVIRONMENT */
+ public static final String MSO_REST_API_OPERATIONAL_ENVIRONMENT_ACTIVATE = "mso.restapi.operationalEnvironment.activate";
+ public static final String MSO_REST_API_OPERATIONAL_ENVIRONMENT_DEACTIVATE = "mso.restapi.operationalEnvironment.deactivate";
+
+ /** The Constant MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE */
+ public static final String MSO_REST_API_OPERATIONAL_ENVIRONMENT_CREATE = "mso.restapi.operationalEnvironment.create";
+
+ /** The Constant MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS */
+ public static final String MSO_REST_API_CLOUD_RESOURCES_REQUEST_STATUS = "mso.restapi.operationalEnvironment.cloudResourcesRequests.status";
+
+ /** The logger. */
+ public EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoProperties.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
index d5a4a87ef..b890114b5 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoResponseWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper.java
@@ -1,107 +1,129 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the MSO response in the format expected by the pages.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "status",
- "entity"
-})
-
-public class MsoResponseWrapper {
-
- /** The status. */
- @JsonProperty("status")
- private int status;
-
- /** The entity. */
- @JsonProperty("entity")
- private String entity;
-
- /**
- * Gets the entity.
- *
- * @return the entity
- */
- @JsonProperty("entity")
- public String getEntity() {
- return entity;
- }
-
- /**
- * Gets the status.
- *
- * @return the status
- */
- @JsonProperty("status")
- public int getStatus() {
- return status;
- }
-
- /**
- * Sets the status.
- *
- * @param v the new status
- */
- @JsonProperty("status")
- public void setStatus(int v) {
- this.status = v;
- }
-
- /**
- * Sets the entity.
- *
- * @param v the new entity
- */
- @JsonProperty("entity")
- public void setEntity(String v) {
- this.entity = v;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /**
- * Gets the response.
- *
- * @return the response
- */
- public String getResponse () {
-
- StringBuilder b = new StringBuilder ("{ \"status\": ");
- b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
- return (b.toString());
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+import javax.ws.rs.core.Response;
+
+/**
+ * This wrapper encapsulates the MSO response in the format expected by the pages.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "status",
+ "entity"
+})
+
+public class MsoResponseWrapper implements MsoResponseWrapperInterface {
+
+
+ public MsoResponseWrapper() {
+ }
+
+ public MsoResponseWrapper(Response response) {
+ setEntity(response.readEntity(String.class));
+ setStatus(response.getStatus());
+ }
+
+
+ /** The status. */
+ @JsonProperty("status")
+ private int status;
+
+ /** The entity. */
+ @JsonProperty("entity")
+ private String entity;
+
+ /**
+ * Gets the entity.
+ *
+ * @return the entity
+ */
+ @Override
+ @JsonProperty("entity")
+ public String getEntity() {
+ return entity;
+ }
+
+ /**
+ * Gets the status.
+ *
+ * @return the status
+ */
+ @Override
+ @JsonProperty("status")
+ public int getStatus() {
+ return status;
+ }
+
+ /**
+ * Sets the status.
+ *
+ * @param v the new status
+ */
+ @JsonProperty("status")
+ public void setStatus(int v) {
+ this.status = v;
+ }
+
+ /**
+ * Sets the entity.
+ *
+ * @param v the new entity
+ */
+ @JsonProperty("entity")
+ public void setEntity(String v) {
+ this.entity = v;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /**
+ * Gets the response.
+ *
+ * @return the response
+ */
+ @org.codehaus.jackson.annotate.JsonIgnore
+ @com.fasterxml.jackson.annotation.JsonIgnore
+ public String getResponse () {
+
+ StringBuilder b = new StringBuilder ("{ \"status\": ");
+ b.append(getStatus()).append(", \"entity\": " );
+ if (this.getEntity() == null || this.getEntity().isEmpty()) {
+ b.append("\"\"");
+ } else {
+ b.append(this.getEntity());
+ }
+ b.append("}");
+ return (b.toString());
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java
new file mode 100644
index 000000000..5a73a048a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapper2.java
@@ -0,0 +1,60 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+
+@JsonPropertyOrder({
+ "status",
+ "entity"
+})
+
+/*
+This is a brother of MsoResponseWrapper. I (Ittay) think it's better.
+It is generic, immutable, and has some knowledge about RestObject.
+The serialized "entity" field may be either String or nested object.
+ */
+public class MsoResponseWrapper2<T> implements MsoResponseWrapperInterface {
+
+ final static ObjectMapper objectMapper = new ObjectMapper();
+
+ private final int status;
+ private final T entity;
+ private final String raw;
+
+ public MsoResponseWrapper2(RestObject<T> msoResponse) {
+ this.status = msoResponse.getStatusCode();
+ this.entity = msoResponse.get();
+ this.raw = msoResponse.getRaw();
+ }
+
+ public MsoResponseWrapper2(
+ @JsonProperty(value = "status", required = true) int status,
+ @JsonProperty(value = "entity", required = true) T entity) {
+ this.status = status;
+ this.entity = entity;
+ this.raw = null;
+ }
+
+ public int getStatus() {
+ return status;
+ }
+
+ @Override
+ @org.codehaus.jackson.annotate.JsonIgnore
+ @com.fasterxml.jackson.annotation.JsonIgnore
+ public String getResponse() {
+ try {
+ return objectMapper.writeValueAsString(this);
+ } catch (JsonProcessingException e) {
+ return getEntity() != null ? getEntity().toString() : null;
+ }
+ }
+
+ @JsonProperty
+ public Object getEntity() {
+ return entity != null ? entity : raw;
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java
new file mode 100644
index 000000000..ad251bdeb
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoResponseWrapperInterface.java
@@ -0,0 +1,15 @@
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+public interface MsoResponseWrapperInterface {
+ @JsonProperty("entity")
+ Object getEntity();
+
+ @JsonProperty("status")
+ int getStatus();
+
+ @org.codehaus.jackson.annotate.JsonIgnore
+ @com.fasterxml.jackson.annotation.JsonIgnore
+ String getResponse();
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
index 2c0148bb7..eae705aba 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/MsoUtil.java
@@ -1,125 +1,126 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.glassfish.jersey.client.ClientResponse;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.controller.MsoController;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * The Class MsoUtil.
- */
-public class MsoUtil {
-
- /** The logger. */
- private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoController.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * Wrap response.
- *
- * @param body the body
- * @param statusCode the status code
- * @return the mso response wrapper
- */
- public static MsoResponseWrapper wrapResponse ( String body, int statusCode ) {
-
- MsoResponseWrapper w = new MsoResponseWrapper();
- w.setStatus (statusCode);
- w.setEntity(body);
-
- return w;
- }
-
- /**
- * Wrap response.
- *
- * @param cres the cres
- * @return the mso response wrapper
- */
- public static MsoResponseWrapper wrapResponse (ClientResponse cres) {
- String resp_str = "";
- if ( cres != null ) {
- resp_str = cres.readEntity(String.class);
- }
- int statuscode = cres.getStatus();
- MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, statuscode );
- return (w);
- }
-
- /**
- * Wrap response.
- *
- * @param rs the rs
- * @return the mso response wrapper
- */
- public static MsoResponseWrapper wrapResponse (RestObject<String> rs) {
- String resp_str = "";
- int status = 0;
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- }
- MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, status );
- return (w);
- }
-
- /**
- * Convert pojo to string.
- *
- * @param <T> the generic type
- * @param t the t
- * @return the string
- * @throws JsonProcessingException the json processing exception
- */
- public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-
- String methodName = "convertPojoToString";
- ObjectMapper mapper = new ObjectMapper();
- String r_json_str = "";
- if ( t != null ) {
- try {
- r_json_str = mapper.writeValueAsString(t);
- }
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json");
- }
- }
- return (r_json_str);
- }
-
- /**
- * The main method.
- *
- * @param args the arguments
- */
- public static void main(String[] args) {
- // TODO Auto-generated method stub
-
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.glassfish.jersey.client.ClientResponse;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+
+import static org.onap.vid.utils.Logging.getMethodName;
+
+/**
+ * The Class MsoUtil.
+ */
+public class MsoUtil {
+
+ /** The logger. */
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoUtil.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ /**
+ * Wrap response.
+ *
+ * @param body the body
+ * @param statusCode the status code
+ * @return the mso response wrapper
+ */
+ public static MsoResponseWrapper wrapResponse ( String body, int statusCode ) {
+
+ MsoResponseWrapper w = new MsoResponseWrapper();
+ w.setStatus (statusCode);
+ w.setEntity(body);
+
+ return w;
+ }
+
+ /**
+ * Wrap response.
+ *
+ * @param cres the cres
+ * @return the mso response wrapper
+ */
+ public static MsoResponseWrapper wrapResponse (ClientResponse cres) {
+ String resp_str = "";
+ if ( cres != null ) {
+ resp_str = cres.readEntity(String.class);
+ }
+ int statuscode = cres.getStatus();
+ MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, statuscode );
+ return (w);
+ }
+
+ /**
+ * Wrap response.
+ *
+ * @param rs the rs
+ * @return the mso response wrapper
+ */
+ public static MsoResponseWrapper wrapResponse (RestObject<String> rs) {
+ String resp_str = null;
+ int status = 0;
+ if ( rs != null ) {
+ resp_str = rs.get() != null ? rs.get() : rs.getRaw();
+ status = rs.getStatusCode();
+ }
+ MsoResponseWrapper w = MsoUtil.wrapResponse ( resp_str, status );
+ return (w);
+ }
+
+ /**
+ * Convert pojo to string.
+ *
+ * @param <T> the generic type
+ * @param t the t
+ * @return the string
+ * @throws JsonProcessingException the json processing exception
+ */
+ public static <T> String convertPojoToString ( T t ) {
+
+ String methodName = "convertPojoToString";
+ ObjectMapper mapper = new ObjectMapper();
+ String r_json_str = "";
+ if ( t != null ) {
+ try {
+ r_json_str = mapper.writeValueAsString(t);
+ }
+ catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
+ logger.debug(EELFLoggerDelegate.debugLogger,getMethodName() + " Unable to parse object of type " + t.getClass().getName() + " as json", j);
+ }
+ }
+ return (r_json_str);
+ }
+
+ /**
+ * The main method.
+ *
+ * @param args the arguments
+ */
+ public static void main(String[] args) {
+ // TODO Auto-generated method stub
+
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestMsoImplementation.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
index ba0fdfaa8..8cee23b49 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestMsoImplementation.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestMsoImplementation.java
@@ -1,18 +1,23 @@
-package org.openecomp.vid.mso;
+package org.onap.vid.mso;
+import com.att.eelf.configuration.EELFLogger;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.apache.commons.codec.binary.Base64;
import org.eclipse.jetty.util.security.Password;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.changeManagement.MsoRequestDetails;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.client.HttpsBasicClient;
-import org.openecomp.vid.mso.rest.RequestDetails;
-import org.openecomp.vid.mso.rest.RestInterface;
-
+import org.onap.vid.client.HttpBasicClient;
+import org.onap.vid.client.HttpsBasicClient;
+import org.onap.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RestInterface;
+import org.onap.vid.utils.Logging;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+
+import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Entity;
+import javax.ws.rs.client.Invocation;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.Response;
@@ -21,6 +26,8 @@ import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
+import static org.onap.vid.utils.Logging.*;
+
/**
* Created by pickjonathan on 26/06/2017.
*/
@@ -30,6 +37,7 @@ public class RestMsoImplementation implements RestInterface {
* The logger.
*/
EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(RestMsoImplementation.class);
+ final private EELFLogger outgoingRequestsLogger = Logging.getRequestsLogger("mso");
/**
* The Constant dateFormat.
@@ -40,13 +48,14 @@ public class RestMsoImplementation implements RestInterface {
private static Client client = null;
/** The common headers. */
- private MultivaluedHashMap<String, Object> commonHeaders;
+ //private MultivaluedHashMap<String, Object> commonHeaders;
/**
* Instantiates a new mso rest interface.
*/
+ @SuppressWarnings("Duplicates")
@Override
- public void initMsoClient()
+ public MultivaluedHashMap<String, Object> initMsoClient()
{
final String methodname = "initRestClient()";
@@ -60,8 +69,11 @@ public class RestMsoImplementation implements RestInterface {
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
String authStringEnc = new String(authEncBytes);
- commonHeaders = new MultivaluedHashMap<String, Object>();
- commonHeaders.put("Authorization", Collections.singletonList((Object) ("Basic " + authStringEnc)));
+ MultivaluedHashMap<String, Object> commonHeaders = new MultivaluedHashMap();
+ commonHeaders.put("Authorization", Collections.singletonList(("Basic " + authStringEnc)));
+ commonHeaders.put(requestIdHeaderKey, Collections.singletonList(getHttpServletRequest().getHeader(requestIdHeaderKey)));
+ //Pass calling application identifier to SO
+ commonHeaders.put("X-FromAppId", Collections.singletonList(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)));
boolean use_ssl = true;
if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {
@@ -89,6 +101,8 @@ public class RestMsoImplementation implements RestInterface {
logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodname + " Unable to get the SSL client");
}
}
+
+ return commonHeaders;
}
public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
@@ -100,16 +114,15 @@ public class RestMsoImplementation implements RestInterface {
restObject.set(t);
url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
-
- initMsoClient();
+ MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
final Response cres = client.target(url)
.request()
.accept("application/json")
.headers(commonHeaders)
.get();
-
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.GET, url, cres);
int status = cres.getStatus();
restObject.setStatusCode (status);
@@ -127,6 +140,35 @@ public class RestMsoImplementation implements RestInterface {
return;
}
+ public <T> RestObject<T> GetForObject(String sourceID, String path, Class<T> clazz) throws Exception {
+ final String methodName = getMethodName();
+ logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {}, {})", getMethodCallerName(), methodName, sourceID, path, clazz);
+
+ String url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
+
+ MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.GET, url);
+ final Response cres = client.target(url)
+ .request()
+ .accept("application/json")
+ .headers(commonHeaders)
+ .get();
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.GET, url, cres);
+ final RestObject<T> restObject = cresToRestObject(cres, clazz);
+ int status = cres.getStatus();
+
+ if (status == 200 || status == 202) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
+ }
+
+ logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
+
+ return restObject;
+ }
+
@Override
public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
@@ -135,23 +177,19 @@ public class RestMsoImplementation implements RestInterface {
Response cres = null;
logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
- logRequest (r);
try {
- initMsoClient();
+ MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
-
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.DELETE, url, r);
cres = client.target(url)
.request()
.accept("application/json")
.headers(commonHeaders)
//.entity(r)
.build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
- // .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
- //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.DELETE, url, cres);
int status = cres.getStatus();
restObject.setStatusCode (status);
@@ -186,38 +224,56 @@ public class RestMsoImplementation implements RestInterface {
}
}
-
+
+ public <T> RestObject<T> PostForObject(Object requestDetails, String sourceID, String path, Class<T> clazz) throws RuntimeException {
+ logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {}, {}, {})", getMethodCallerName(), getMethodName(), requestDetails, sourceID, path, clazz);
+ RestObject<T> restObject = new RestObject<>();
+ Post(clazz, requestDetails, sourceID, path, restObject);
+ return restObject;
+ }
+
@Override
- public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
+ public <T> void Post(T t, Object r, String sourceID, String path, RestObject<T> restObject) throws RuntimeException {
+ logger.debug(EELFLoggerDelegate.debugLogger, "start {}->{}({}, {}, {}, {})", getMethodCallerName(), getMethodName(), t.getClass(), r, sourceID, path);
+ Post(t.getClass(), r, sourceID, path, restObject);
+ }
+
+ public Invocation.Builder prepareClient(String path, String methodName) {
+ MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+
+ String url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
+ // Change the content length
+ return client.target(url)
+ .request()
+ .accept("application/json")
+ .headers(commonHeaders);
+ }
+
+
+
+ public <T> void Post(Class<?> tClass, Object requestDetails, String sourceID, String path, RestObject<T> restObject) throws RuntimeException {
String methodName = "Post";
String url="";
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- logRequest (r);
try {
- initMsoClient();
+ MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.POST, url, requestDetails);
// Change the content length
final Response cres = client.target(url)
.request()
.accept("application/json")
.headers(commonHeaders)
- //.header("content-length", 201)
- //.header("X-FromAppId", sourceID)
- .post(Entity.entity(r, MediaType.APPLICATION_JSON));
+ .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.POST, url, cres);
- try {
- t = (T) cres.readEntity(t.getClass());
- restObject.set(t);
- }
- catch ( Exception e ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
- + e.getMessage());
- }
+ final RestObject<T> cresToRestObject = cresToRestObject(cres, tClass);
+ restObject.set(cresToRestObject.get());
+ restObject.setStatusCode(cresToRestObject.getStatusCode());
+ restObject.setRaw(cresToRestObject.getRaw());
int status = cres.getStatus();
restObject.setStatusCode (status);
@@ -236,91 +292,89 @@ public class RestMsoImplementation implements RestInterface {
throw e;
}
+
+ logger.debug(EELFLoggerDelegate.debugLogger, "end {}() => ({}){}", getMethodName(), tClass, restObject);
}
- @Override
- public void logRequest(RequestDetails r) {
- String methodName = "logRequest";
- ObjectMapper mapper = new ObjectMapper();
- String r_json_str = "";
- if ( r != null ) {
- r_json_str = r.toString();
+ private <T> RestObject<T> cresToRestObject(Response cres, Class<?> tClass) {
+ RestObject<T> restObject = new RestObject<>();
+
+ String rawEntity = null;
+ try {
+ cres.bufferEntity();
+ rawEntity = cres.readEntity(String.class);
+ T t = (T) new ObjectMapper().readValue(rawEntity, tClass);
+ restObject.set(t);
+ }
+ catch ( Exception e ) {
try {
- r_json_str = mapper.writeValueAsString(r);
- }
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse request as json");
+ restObject.setRaw(rawEntity);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " Error reading response entity as " + tClass + ": , e="
+ + e.getMessage() + ", Entity=" + rawEntity);
+ } catch (Exception e2) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " No response entity, this is probably ok, e="
+ + e.getMessage());
}
}
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Request=(" + r_json_str + ")");
+
+ int status = cres.getStatus();
+ restObject.setStatusCode (status);
+
+ return restObject;
+
}
-
+
@Override
- public void logRequest(org.openecomp.vid.changeManagement.RequestDetails r) {
- String methodName = "logRequest";
- ObjectMapper mapper = new ObjectMapper();
- String r_json_str = "";
- if ( r != null ) {
- r_json_str = r.toString();
+ public <T> void Put(T t, org.onap.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception {
+
+ String methodName = "Put";
+ String url="";
+
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+// logRequest (r);
+ try {
+
+ MultivaluedHashMap<String, Object> commonHeaders = initMsoClient();
+
+ url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
+ Logging.logRequest(outgoingRequestsLogger, HttpMethod.PUT, url, r);
+ // Change the content length
+ final Response cres = client.target(url)
+ .request()
+ .accept("application/json")
+ .headers(commonHeaders)
+ //.header("content-length", 201)
+ //.header("X-FromAppId", sourceID)
+ .put(Entity.entity(r, MediaType.APPLICATION_JSON));
+
+ Logging.logResponse(outgoingRequestsLogger, HttpMethod.PUT, url, cres);
+
try {
- r_json_str = mapper.writeValueAsString(r);
+ t = (T) cres.readEntity(t.getClass());
+ restObject.set(t);
}
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse request as json");
+ catch ( Exception e ) {
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
+ + e.getMessage());
}
- }
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Request=(" + r_json_str + ")");
- }
- @Override
- public <T> void Put(T t, org.openecomp.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
- String methodName = "Put";
- String url="";
+ int status = cres.getStatus();
+ restObject.setStatusCode (status);
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
+ if ( status >= 200 && status <= 299 ) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-// logRequest (r);
- try {
-
- initMsoClient();
-
- url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
- // Change the content length
- final Response cres = client.target(url)
- .request()
- .accept("application/json")
- .headers(commonHeaders)
- //.header("content-length", 201)
- //.header("X-FromAppId", sourceID)
- .put(Entity.entity(r, MediaType.APPLICATION_JSON));
-
- try {
- t = (T) cres.readEntity(t.getClass());
- restObject.set(t);
- }
- catch ( Exception e ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
- + e.getMessage());
- }
-
- int status = cres.getStatus();
- restObject.setStatusCode (status);
-
- if ( status >= 200 && status <= 299 ) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-
- } else {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
- }
-
- } catch (Exception e)
- {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
- throw e;
-
- }
- }
+ } else {
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
+ }
+
+ } catch (Exception e)
+ {
+ logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
+ throw e;
+
+ }
+ }
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
new file mode 100644
index 000000000..4e2bea050
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/RestObject.java
@@ -0,0 +1,131 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import com.google.common.base.MoreObjects;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+
+import javax.ws.rs.core.Response;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import static org.onap.vid.utils.Logging.getMethodCallerName;
+
+/**
+ * The Class RestObject.
+ *
+ * @param <T> the generic type
+ */
+public class RestObject<T> {
+
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+
+ final static ObjectMapper objectMapper = new ObjectMapper();
+
+ /**
+ * Generic version of the RestObject class.
+ *
+ */
+ // T stands for "Type"
+ private T t;
+
+ // The string source of t, if available
+ private String rawT;
+
+ /** The status code. */
+ private int statusCode= 0;
+
+ public RestObject() {
+ }
+
+ public RestObject(Response cres, Class<?> tClass, EELFLoggerDelegate logger) {
+
+ String rawEntity = null;
+ try {
+ cres.bufferEntity();
+ rawEntity = cres.readEntity(String.class);
+ T t = (T) objectMapper.readValue(rawEntity, tClass);
+ this.set(t);
+ }
+ catch ( Exception e ) {
+ try {
+ this.setRaw(rawEntity);
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " Error reading response entity as " + tClass + ": , e="
+ + e.getMessage() + ", Entity=" + rawEntity);
+ } catch (Exception e2) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + getMethodCallerName() + " No response entity, this is probably ok, e="
+ + e.getMessage());
+ }
+ }
+
+ int status = cres.getStatus();
+ this.setStatusCode (status);
+ }
+
+
+ /**
+ * Sets the.
+ *
+ * @param t the t
+ */
+ public void set(T t) { this.t = t; }
+
+ /**
+ * Gets the.
+ *
+ * @return the t
+ */
+ public T get() { return t; }
+
+ /**
+ * Sets the status code.
+ *
+ * @param v the new status code
+ */
+ public void setStatusCode(int v) { this.statusCode = v; }
+
+ /**
+ * Gets the status code.
+ *
+ * @return the status code
+ */
+ public int getStatusCode() { return this.statusCode; }
+
+ public String getRaw() {
+ return rawT;
+ }
+
+ public void setRaw(String rawT) {
+ this.rawT = rawT;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("t", t)
+ .add("rawT", rawT)
+ .add("statusCode", statusCode)
+ .toString();
+ }
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java
new file mode 100644
index 000000000..bca643a6d
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentActivateInfo.java
@@ -0,0 +1,33 @@
+package org.onap.vid.mso.model;
+
+import com.google.common.base.MoreObjects;
+import org.onap.vid.controller.OperationalEnvironmentController;
+
+public class OperationalEnvironmentActivateInfo extends OperationalEnvironmentController.OperationalEnvironmentActivateBody {
+ private final String userId;
+ private final String operationalEnvironmentId;
+
+ public OperationalEnvironmentActivateInfo(OperationalEnvironmentController.OperationalEnvironmentActivateBody o, String userId, String operationalEnvironmentId) {
+ super(o.getRelatedInstanceId(), o.getRelatedInstanceName(), o.getWorkloadContext(), o.getManifest());
+
+ this.userId = userId;
+ this.operationalEnvironmentId = operationalEnvironmentId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public String getOperationalEnvironmentId() {
+ return operationalEnvironmentId;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("operationalEnvironmentId", operationalEnvironmentId)
+ .add("userId", userId)
+ .add("super", super.toString())
+ .toString();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java
new file mode 100644
index 000000000..1a756eda8
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/model/OperationalEnvironmentDeactivateInfo.java
@@ -0,0 +1,29 @@
+package org.onap.vid.mso.model;
+
+import com.google.common.base.MoreObjects;
+
+public class OperationalEnvironmentDeactivateInfo {
+ private final String userId;
+ private final String operationalEnvironmentId;
+
+ public OperationalEnvironmentDeactivateInfo(String userId, String operationalEnvironmentId) {
+ this.userId = userId;
+ this.operationalEnvironmentId = operationalEnvironmentId;
+ }
+
+ public String getUserId() {
+ return userId;
+ }
+
+ public String getOperationalEnvironmentId() {
+ return operationalEnvironmentId;
+ }
+
+ @Override
+ public String toString() {
+ return MoreObjects.toStringHelper(this)
+ .add("operationalEnvironmentId", operationalEnvironmentId)
+ .add("userId", userId)
+ .toString();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
index 1395f9ae3..f47e16fe0 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/AsyncRequestStatus.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/AsyncRequestStatus.java
@@ -1,123 +1,123 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-//import java.util.HashMap;
-//import java.util.Map;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.InstanceIds;
-import org.openecomp.vid.domain.mso.RequestStatus;
-//import com.fasterxml.jackson.annotation.JsonAnyGetter;
-//import com.fasterxml.jackson.annotation.JsonAnySetter;
-//import com.fasterxml.jackson.annotation.JsonCreator;
-//import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-//import com.fasterxml.jackson.annotation.JsonValue;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * request structure.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-
-public class AsyncRequestStatus extends org.openecomp.vid.domain.mso.AsyncRequestStatus {
-
-
- /** The instance ids. */
- private InstanceIds instanceIds;
-
- /** The request status. */
- private RequestStatus requestStatus;
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#getInstanceIds()
- */
- public InstanceIds getInstanceIds() {
- return instanceIds;
- }
-
- /**
- * Sets the instance ids.
- *
- * @param instanceIds the new instance ids
- */
- public void setInstanceIds(InstanceIds instanceIds) {
- this.instanceIds = instanceIds;
- }
-
-
- /**
- * (Required).
- *
- * @return The requestStatus
- */
- @JsonProperty("requestStatus")
- public RequestStatus getRequestStatus() {
- return requestStatus;
- }
-
- /**
- * (Required).
- *
- * @param requestStatus The requestStatus
- */
- @JsonProperty("requestStatus")
- public void setRequestStatus(RequestStatus requestStatus) {
- this.requestStatus = requestStatus;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#hashCode()
- */
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(getCorrelator()).append(getFinishTime()).append(instanceIds).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof AsyncRequestStatus) == false) {
- return false;
- }
- AsyncRequestStatus rhs = ((AsyncRequestStatus) other);
- return new EqualsBuilder().append(getCorrelator(), rhs.getCorrelator()).append(getFinishTime(), rhs.getFinishTime()).append(instanceIds, rhs.instanceIds).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+//import java.util.HashMap;
+//import java.util.Map;
+//import javax.annotation.Generated;
+
+import org.onap.vid.domain.mso.InstanceIds;
+import org.onap.vid.domain.mso.RequestStatus;
+//import com.fasterxml.jackson.annotation.JsonAnyGetter;
+//import com.fasterxml.jackson.annotation.JsonAnySetter;
+//import com.fasterxml.jackson.annotation.JsonCreator;
+//import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+//import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * request structure.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+
+public class AsyncRequestStatus extends org.onap.vid.domain.mso.AsyncRequestStatus {
+
+
+ /** The instance ids. */
+ private InstanceIds instanceIds;
+
+ /** The request status. */
+ private RequestStatus requestStatus;
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#getInstanceIds()
+ */
+ public InstanceIds getInstanceIds() {
+ return instanceIds;
+ }
+
+ /**
+ * Sets the instance ids.
+ *
+ * @param instanceIds the new instance ids
+ */
+ public void setInstanceIds(InstanceIds instanceIds) {
+ this.instanceIds = instanceIds;
+ }
+
+
+ /**
+ * (Required).
+ *
+ * @return The requestStatus
+ */
+ @JsonProperty("requestStatus")
+ public RequestStatus getRequestStatus() {
+ return requestStatus;
+ }
+
+ /**
+ * (Required).
+ *
+ * @param requestStatus The requestStatus
+ */
+ @JsonProperty("requestStatus")
+ public void setRequestStatus(RequestStatus requestStatus) {
+ this.requestStatus = requestStatus;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(getCorrelator()).append(getFinishTime()).append(instanceIds).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.AsyncRequestStatus#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof AsyncRequestStatus) == false) {
+ return false;
+ }
+ AsyncRequestStatus rhs = ((AsyncRequestStatus) other);
+ return new EqualsBuilder().append(getCorrelator(), rhs.getCorrelator()).append(getFinishTime(), rhs.getFinishTime()).append(instanceIds, rhs.instanceIds).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
index 1beeafb13..9bb54035d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoRestClientNew.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/MsoRestClientNew.java
@@ -1,9 +1,11 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.changeManagement.MsoRequestDetails;
-import org.openecomp.vid.changeManagement.RequestDetailsWrapper;
-import org.openecomp.vid.mso.*;
+import org.onap.vid.changeManagement.MsoRequestDetails;
+import org.onap.vid.changeManagement.RequestDetailsWrapper;
+import org.onap.vid.model.RequestReferencesContainer;
+import org.onap.vid.mso.*;
+
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
@@ -15,17 +17,14 @@ import java.util.Date;
public class MsoRestClientNew extends RestMsoImplementation implements MsoInterface {
/**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
-
- /**
* The Constant dateFormat.
*/
final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
private final String ORIGINAL_REQUEST_ID = "originalRequestId";
-
+ /**
+ * The logger.
+ */
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestClientNew.class);
@Override
public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
@@ -70,6 +69,14 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
@Override
+ public MsoResponseWrapper createConfigurationInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+ String methodName = "createConfigurationInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ return createInstance(requestDetails, endpoint);
+ }
+
+ @Override
public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
String methodName = "deleteSvcInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
@@ -174,7 +181,7 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
- public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception{
+ public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
String methodName = "getOrchestrationRequestsForDashboard";
logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
@@ -185,25 +192,25 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
return w;
- } catch (Exception e){
+ } catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
throw e;
}
}
- public MsoResponseWrapper getManualTasksByRequestId(String t , String sourceId , String endpoint , RestObject restObject) throws Exception{
+ public MsoResponseWrapper getManualTasksByRequestId(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
String methodName = "getManualTasksByRequestId";
logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
try {
- getManualTasks(t , sourceId , endpoint , restObject);
+ getManualTasks(t, sourceId, endpoint, restObject);
MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
return MsoUtil.wrapResponse(restObject);
- } catch (Exception e){
+ } catch (Exception e) {
logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
throw e;
@@ -211,14 +218,13 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
-
@Override
public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
String methodName = "completeManualTask";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Complete ");
try {
- Post(t, requestDetails , sourceId, endpoint, restObject);
+ Post(t, requestDetails, sourceId, endpoint, restObject);
MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w=" + w.getResponse());
@@ -232,38 +238,97 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
@Override
- public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
+ public MsoResponseWrapper replaceVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
String methodName = "replaceVnf";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
return replaceInstance(requestDetails, endpoint);
}
- public MsoResponseWrapper replaceInstance(org.openecomp.vid.changeManagement.RequestDetails request, String path) throws Exception {
+ @Override
+ public MsoResponseWrapper deleteConfiguration(RequestDetails requestDetails, String pmc_endpoint)
+ throws Exception {
+ String methodName = "deleteConfiguration";
+ logger.debug(EELFLoggerDelegate.debugLogger,
+ dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ return deleteInstance(requestDetails, pmc_endpoint);
+ }
+
+ @Override
+ public MsoResponseWrapper setConfigurationActiveStatus(RequestDetails request, String path) throws Exception {
+ String methodName = "setConfigurationActiveStatus";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ try {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling change configuration active status, path =[" + path + "]");
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+ Post(str, request, "", path, restObjStr);
+ MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
+
+ return msoResponseWrapperObject;
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public MsoResponseWrapper setPortOnConfigurationStatus(RequestDetails request, String path) throws Exception {
+ String methodName = "setPortOnConfigurationStatus";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ try {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling change port configuration status, path =[" + path + "]");
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = new String();
+ restObjStr.set(str);
+ Post(str, request, "", path, restObjStr);
+ MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
+
+ return msoResponseWrapperObject;
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public MsoResponseWrapperInterface changeManagementUpdate(RequestDetailsWrapper requestDetails, String endpoint) throws Exception {
+ RestObject<RequestReferencesContainer> msoResponse = PostForObject(requestDetails, "", endpoint, RequestReferencesContainer.class);
+ return new MsoResponseWrapper2<>(msoResponse);
+ }
+
+ public MsoResponseWrapper replaceInstance(org.onap.vid.changeManagement.RequestDetails request, String path) throws Exception {
String methodName = "replaceInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
try {
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Replace VNF, path =[" + path + "]");
+
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Replace VNF, path =[" + path + "]");
RestObject<String> restObjStr = new RestObject<String>();
String str = new String();
restObjStr.set(str);
RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
- Post(str, request, "", path, restObjStr);
+ Post(str, requestDetailsWrapper, "", path, restObjStr);
MsoResponseWrapper msoResponseWrapperObject = MsoUtil.wrapResponse(restObjStr);
int status = msoResponseWrapperObject.getStatus();
- if (status == 202){
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
- ",post succeeded, msoResponseWrapperObject response:" + msoResponseWrapperObject.getResponse());
- }
- else {
- logger.error(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
- ": post failed, msoResponseWrapperObject status" + status + ", response:" + msoResponseWrapperObject.getResponse());
-
- // TODO
+ if (status == 202) {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
+ ",post succeeded, msoResponseWrapperObject response:" + msoResponseWrapperObject.getResponse());
+ } else {
+ logger.error(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName +
+ ": post failed, msoResponseWrapperObject status" + status + ", response:" + msoResponseWrapperObject.getResponse());
+
+ // TODO
}
return msoResponseWrapperObject;
@@ -276,29 +341,25 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
@Override
- public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
+ public MsoResponseWrapper updateVnf(org.onap.vid.changeManagement.RequestDetails requestDetails, String endpoint) throws Exception {
String methodName = "updateVnf";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
RequestDetailsWrapper wrapper = new RequestDetailsWrapper();
- wrapper.requestDetails = new MsoRequestDetails(requestDetails);;
+ wrapper.requestDetails = new MsoRequestDetails(requestDetails);
return updateInstance(requestDetails, endpoint);
}
- public MsoResponseWrapper updateInstance(org.openecomp.vid.changeManagement.RequestDetails request, String path) throws Exception {
+ public MsoResponseWrapper updateInstance(org.onap.vid.changeManagement.RequestDetails request, String path) throws Exception {
String methodName = "updateInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
try {
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Delete, path =[" + path + "]");
-
RestObject<String> restObjStr = new RestObject<String>();
String str = new String();
restObjStr.set(str);
RequestDetailsWrapper requestDetailsWrapper = new RequestDetailsWrapper();
requestDetailsWrapper.requestDetails = new MsoRequestDetails(request);
-
-
-
Put(str, requestDetailsWrapper, "", path, restObjStr);
MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
@@ -313,12 +374,12 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
- public void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception{
+ public void setServiceInstanceStatus(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception {
String methodName = "activateServiceInstance";
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start ");
try {
- Post(t, requestDetails , sourceId, endpoint, restObject);
+ Post(t, requestDetails, sourceId, endpoint, restObject);
MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " w =" + w.getResponse());
@@ -330,4 +391,45 @@ public class MsoRestClientNew extends RestMsoImplementation implements MsoInterf
}
}
+ @Override
+ public MsoResponseWrapper removeRelationshipFromServiceInstance(RequestDetails requestDetails, String endpoint) throws Exception {
+ String methodName = "removeRelationshipFromServiceInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ try {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Remove relationship from service instance, path =[" + endpoint + "]");
+
+ RestObject<String> restObjStr = new RestObject<String>();
+ String str = "";
+ restObjStr.set(str);
+ Post(str, requestDetails, "", endpoint, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
+ @Override
+ public MsoResponseWrapper addRelationshipToServiceInstance(RequestDetails requestDetails, String addRelationshipsPath) throws Exception {
+ String methodName = "addRelationshipToServiceInstance";
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
+
+ try {
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " calling Add relationship to service instance, path =[" + addRelationshipsPath + "]");
+
+ RestObject<String> restObjStr = new RestObject<>();
+ restObjStr.set("");
+ Post("", requestDetails, "", addRelationshipsPath, restObjStr);
+
+ return MsoUtil.wrapResponse(restObjStr);
+ } catch (Exception e) {
+ logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
+ throw e;
+ }
+ }
+
} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java
new file mode 100644
index 000000000..2f6d233c2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/OperationalEnvironment/OperationEnvironmentRequestDetails.java
@@ -0,0 +1,120 @@
+package org.onap.vid.mso.rest.OperationalEnvironment;
+
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+import java.util.List;
+
+public class OperationEnvironmentRequestDetails {
+ private final RequestInfo requestInfo;
+ private final List<RelatedInstance> relatedInstanceList;
+ private final RequestParameters requestParameters;
+
+ public OperationEnvironmentRequestDetails(@JsonProperty(value = "requestInfo", required = true) RequestInfo requestInfo,
+ @JsonProperty(value = "relatedInstanceList", required = true) List<RelatedInstance> relatedInstanceList,
+ @JsonProperty(value = "requestParameters", required = true) RequestParameters requestParameters) {
+ this.requestInfo = requestInfo;
+ this.relatedInstanceList = relatedInstanceList;
+ this.requestParameters = requestParameters;
+ }
+
+ public RequestInfo getRequestInfo() {
+ return requestInfo;
+ }
+
+ public List<RelatedInstance> getRelatedInstanceList() {
+ return relatedInstanceList;
+ }
+
+ public RequestParameters getRequestParameters() {
+ return requestParameters;
+ }
+
+ public static class RequestInfo {
+ private final String resourceType;
+ private final String instanceName;
+ private final String source;
+ private final String requestorId;
+
+ public RequestInfo(@JsonProperty(value = "resourceType", required = true) String resourceType,
+ @JsonProperty(value = "instanceName", required = true) String instanceName,
+ @JsonProperty(value = "source", required = true) String source,
+ @JsonProperty(value = "requestorId", required = true) String requestorId) {
+ this.resourceType = resourceType;
+ this.instanceName = instanceName;
+ this.source = source;
+ this.requestorId = requestorId;
+ }
+
+ public String getResourceType() {
+ return resourceType;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public String getSource() {
+ return source;
+ }
+
+ public String getRequestorId() {
+ return requestorId;
+ }
+ }
+
+ public static class RequestParameters {
+ private final String operationalEnvironmentType;
+ private final String tenantContext;
+ private final String workloadContext;
+
+ public RequestParameters(@JsonProperty(value = "operationalEnvironmentType", required = true) String operationalEnvironmentType,
+ @JsonProperty(value = "tenantContext", required = true) String tenantContext,
+ @JsonProperty(value = "workloadContext", required = true) String workloadContext) {
+ this.operationalEnvironmentType = operationalEnvironmentType;
+ this.tenantContext = tenantContext;
+ this.workloadContext = workloadContext;
+ }
+ public String getOperationalEnvironmentType() {
+ return operationalEnvironmentType;
+ }
+
+ public String getTenantContext() {
+ return tenantContext;
+ }
+
+ public String getWorkloadContext() {
+ return workloadContext;
+ }
+ }
+
+ @JsonTypeName("relatedInstance")
+ @JsonTypeInfo(include = JsonTypeInfo.As.WRAPPER_OBJECT, use = JsonTypeInfo.Id.NAME)
+ public static class RelatedInstance {
+ private final String resourceType;
+ private final String instanceId;
+ private final String instanceName;
+
+ public String getResourceType() {
+ return resourceType;
+ }
+
+ public String getInstanceId() {
+ return instanceId;
+ }
+
+ public String getInstanceName() {
+ return instanceName;
+ }
+
+ public RelatedInstance(@JsonProperty(value = "instanceName", required = true) String resourceType,
+ @JsonProperty(value = "instanceId", required = true) String instanceId,
+ @JsonProperty(value = "instanceName", required = true) String instanceName) {
+ this.resourceType = resourceType;
+ this.instanceId = instanceId;
+ this.instanceName = instanceName;
+ }
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
index b68f7c13b..b7f120330 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedInstance.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedInstance.java
@@ -1,125 +1,125 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import javax.annotation.Generated;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * modelInfo and optional instanceId and instanceName for a model related to the modelInfo being operated on.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "instanceName",
- "instanceId",
- "modelInfo"
-})
-public class RelatedInstance extends org.openecomp.vid.domain.mso.RelatedInstance{
-
-
- /** The model info. */
- @JsonProperty("modelInfo")
- private org.openecomp.vid.domain.mso.ModelInfo modelInfo;
-
- /** The additional properties. */
- @JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- /**
- * (Required).
- *
- * @return The modelInfo
- */
- @JsonProperty("modelInfo")
- public org.openecomp.vid.domain.mso.ModelInfo getModelInfo() {
- return modelInfo;
- }
-
- /**
- * (Required).
- *
- * @param modelInfo The modelInfo
- */
- @JsonProperty("modelInfo")
- public void setModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo) {
- this.modelInfo = modelInfo;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedInstance#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedInstance#getAdditionalProperties()
- */
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedInstance#setAdditionalProperty(java.lang.String, java.lang.Object)
- */
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedInstance#hashCode()
- */
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(getInstanceName()).append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedInstance#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof RelatedInstance) == false) {
- return false;
- }
- RelatedInstance rhs = ((RelatedInstance) other);
- return new EqualsBuilder().append(getInstanceName(), rhs.getInstanceName()).append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.getModelInfo()).append(additionalProperties, rhs.additionalProperties).isEquals();
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Generated;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * modelInfo and optional instanceId and instanceName for a model related to the modelInfo being operated on.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Generated("org.jsonschema2pojo")
+@JsonPropertyOrder({
+ "instanceName",
+ "instanceId",
+ "modelInfo"
+})
+public class RelatedInstance extends org.onap.vid.domain.mso.RelatedInstance{
+
+
+ /** The model info. */
+ @JsonProperty("modelInfo")
+ private org.onap.vid.domain.mso.ModelInfo modelInfo;
+
+ /** The additional properties. */
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ /**
+ * (Required).
+ *
+ * @return The modelInfo
+ */
+ @JsonProperty("modelInfo")
+ public org.onap.vid.domain.mso.ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ /**
+ * (Required).
+ *
+ * @param modelInfo The modelInfo
+ */
+ @JsonProperty("modelInfo")
+ public void setModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedInstance#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedInstance#getAdditionalProperties()
+ */
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedInstance#setAdditionalProperty(java.lang.String, java.lang.Object)
+ */
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedInstance#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(getInstanceName()).append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedInstance#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RelatedInstance) == false) {
+ return false;
+ }
+ RelatedInstance rhs = ((RelatedInstance) other);
+ return new EqualsBuilder().append(getInstanceName(), rhs.getInstanceName()).append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.getModelInfo()).append(additionalProperties, rhs.additionalProperties).isEquals();
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
index 427d71dd1..39722e172 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RelatedModel.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RelatedModel.java
@@ -1,125 +1,125 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * modelInfo and optional instance id for a model related to the modelInfo being operated on.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "instanceId",
- "modelInfo"
-})
-public class RelatedModel extends org.openecomp.vid.domain.mso.RelatedModel {
-
- /** (Required). */
- @JsonProperty("modelInfo")
- private org.openecomp.vid.domain.mso.ModelInfo modelInfo;
-
-// /** The related model object instance list. */
-// @JsonProperty("instanceId")
-// private org.openecomp.vid.domain.mso.InstanceIds instanceId;
-
- /** The additional properties. */
- @JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- /**
- * (Required).
- *
- * @return The modelInfo
- */
- @JsonProperty("modelInfo")
- public org.openecomp.vid.domain.mso.ModelInfo getModelInfo() {
- return modelInfo;
- }
-
- /**
- * (Required).
- *
- * @param modelInfo The modelInfo
- */
- @JsonProperty("modelInfo")
- public void setModelInfo(org.openecomp.vid.domain.mso.ModelInfo modelInfo) {
- this.modelInfo = modelInfo;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedModel#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedModel#getAdditionalProperties()
- */
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedModel#setAdditionalProperty(java.lang.String, java.lang.Object)
- */
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedModel#hashCode()
- */
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RelatedModel#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof RelatedModel) == false) {
- return false;
- }
- RelatedModel rhs = ((RelatedModel) other);
- return new EqualsBuilder().append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.modelInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * modelInfo and optional instance id for a model related to the modelInfo being operated on.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "instanceId",
+ "modelInfo"
+})
+public class RelatedModel extends org.onap.vid.domain.mso.RelatedModel {
+
+ /** (Required). */
+ @JsonProperty("modelInfo")
+ private org.onap.vid.domain.mso.ModelInfo modelInfo;
+
+// /** The related model object instance list. */
+// @JsonProperty("instanceId")
+// private org.openecomp.vid.domain.mso.InstanceIds instanceId;
+
+ /** The additional properties. */
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ /**
+ * (Required).
+ *
+ * @return The modelInfo
+ */
+ @JsonProperty("modelInfo")
+ public org.onap.vid.domain.mso.ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ /**
+ * (Required).
+ *
+ * @param modelInfo The modelInfo
+ */
+ @JsonProperty("modelInfo")
+ public void setModelInfo(org.onap.vid.domain.mso.ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedModel#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedModel#getAdditionalProperties()
+ */
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedModel#setAdditionalProperty(java.lang.String, java.lang.Object)
+ */
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedModel#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(getInstanceId()).append(modelInfo).append(additionalProperties).toHashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RelatedModel#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RelatedModel) == false) {
+ return false;
+ }
+ RelatedModel rhs = ((RelatedModel) other);
+ return new EqualsBuilder().append(getInstanceId(), rhs.getInstanceId()).append(modelInfo, rhs.modelInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
index c8f7b8ba7..b1a84ab29 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Request.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Request.java
@@ -1,140 +1,146 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-//import java.util.HashMap;
-//import java.util.Map;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.InstanceIds;
-import org.openecomp.vid.domain.mso.RequestStatus;
-//import com.fasterxml.jackson.annotation.JsonAnyGetter;
-//import com.fasterxml.jackson.annotation.JsonAnySetter;
-//import com.fasterxml.jackson.annotation.JsonCreator;
-//import com.fasterxml.jackson.annotation.JsonIgnore;
-//import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-//import com.fasterxml.jackson.annotation.JsonValue;
-import org.apache.commons.lang.builder.EqualsBuilder;
-//import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * request structure.
- */
-public class Request extends org.openecomp.vid.domain.mso.Request {
-
-
- /** The instance ids. */
- private InstanceIds instanceIds;
-
- /** The request details. */
- private RequestDetails requestDetails;
-
- /** The request status. */
- private RequestStatus requestStatus;
-
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.Request#getInstanceIds()
- */
- @JsonProperty("instanceIds")
- public InstanceIds getInstanceIds() {
- return instanceIds;
- }
-
- /**
- * Sets the instance ids.
- *
- * @param instanceIds The instanceIds
- */
- @JsonProperty("instanceIds")
- public void setInstanceIds(InstanceIds instanceIds) {
- this.instanceIds = instanceIds;
- }
-
- /**
- * (Required).
- *
- * @return The requestDetails
- */
- @JsonProperty("requestDetails")
- public RequestDetails getRequestDetails() {
- return requestDetails;
- }
-
- /**
- * (Required).
- *
- * @param requestDetails The requestDetails
- */
- @JsonProperty("requestDetails")
- public void setRequestDetails(RequestDetails requestDetails) {
- this.requestDetails = requestDetails;
- }
-
-
- /**
- * Gets the request status.
- *
- * @return The requestStatus
- */
- @JsonProperty("requestStatus")
- public RequestStatus getRequestStatus() {
- return requestStatus;
- }
-
- /**
- * Sets the request status.
- *
- * @param requestStatus The requestStatus
- */
- @JsonProperty("requestStatus")
- public void setRequestStatus(RequestStatus requestStatus) {
- this.requestStatus = requestStatus;
- }
-
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.Request#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.Request#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof Request) == false) {
- return false;
- }
- Request rhs = ((Request) other);
- return new EqualsBuilder().append(getFinishTime(), rhs.getFinishTime()).append(getInstanceIds(), rhs.getInstanceIds()).append(getRequestDetails(), rhs.getRequestDetails()).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+//import java.util.HashMap;
+//import java.util.Map;
+//import javax.annotation.Generated;
+
+import org.apache.commons.lang3.builder.HashCodeBuilder;
+import org.onap.vid.domain.mso.InstanceIds;
+import org.onap.vid.domain.mso.RequestStatus;
+//import com.fasterxml.jackson.annotation.JsonAnyGetter;
+//import com.fasterxml.jackson.annotation.JsonAnySetter;
+//import com.fasterxml.jackson.annotation.JsonCreator;
+//import com.fasterxml.jackson.annotation.JsonIgnore;
+//import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+//import com.fasterxml.jackson.annotation.JsonValue;
+import org.apache.commons.lang.builder.EqualsBuilder;
+//import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * request structure.
+ */
+public class Request extends org.onap.vid.domain.mso.Request {
+
+
+ /** The instance ids. */
+ private InstanceIds instanceIds;
+
+ /** The request details. */
+ private RequestDetails requestDetails;
+
+ /** The request status. */
+ private RequestStatus requestStatus;
+
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.Request#getInstanceIds()
+ */
+ @JsonProperty("instanceIds")
+ public InstanceIds getInstanceIds() {
+ return instanceIds;
+ }
+
+ /**
+ * Sets the instance ids.
+ *
+ * @param instanceIds The instanceIds
+ */
+ @JsonProperty("instanceIds")
+ public void setInstanceIds(InstanceIds instanceIds) {
+ this.instanceIds = instanceIds;
+ }
+
+ /**
+ * (Required).
+ *
+ * @return The requestDetails
+ */
+ @JsonProperty("requestDetails")
+ public RequestDetails getRequestDetails() {
+ return requestDetails;
+ }
+
+ /**
+ * (Required).
+ *
+ * @param requestDetails The requestDetails
+ */
+ @JsonProperty("requestDetails")
+ public void setRequestDetails(RequestDetails requestDetails) {
+ this.requestDetails = requestDetails;
+ }
+
+
+ /**
+ * Gets the request status.
+ *
+ * @return The requestStatus
+ */
+ @JsonProperty("requestStatus")
+ public RequestStatus getRequestStatus() {
+ return requestStatus;
+ }
+
+ /**
+ * Sets the request status.
+ *
+ * @param requestStatus The requestStatus
+ */
+ @JsonProperty("requestStatus")
+ public void setRequestStatus(RequestStatus requestStatus) {
+ this.requestStatus = requestStatus;
+ }
+
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.Request#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.Request#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof Request) == false) {
+ return false;
+ }
+ Request rhs = ((Request) other);
+ return new EqualsBuilder().append(getFinishTime(), rhs.getFinishTime()).append(getInstanceIds(), rhs.getInstanceIds()).append(getRequestDetails(), rhs.getRequestDetails()).append(getRequestId(), rhs.getRequestId()).append(getRequestScope(), rhs.getRequestScope()).append(getRequestStatus(), rhs.getRequestStatus()).append(getRequestType(), rhs.getRequestType()).append(getStartTime(), rhs.getStartTime()).append(getAdditionalProperties(), rhs.getAdditionalProperties()).isEquals();
+ }
+
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder(17, 37).append(getFinishTime()).append(getInstanceIds()).append(getRequestDetails()).append(getRequestId()).append(getRequestScope()).append(getRequestStatus()).append(getRequestType()).append(getStartTime()).append(getAdditionalProperties()).toHashCode();
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
index 0cf697e0b..1e059896f 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestDetails.java
@@ -1,232 +1,235 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.List;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.CloudConfiguration;
-import org.openecomp.vid.domain.mso.ModelInfo;
-import org.openecomp.vid.domain.mso.RequestInfo;
-import org.openecomp.vid.domain.mso.RequestParameters;
-import org.openecomp.vid.domain.mso.SubscriberInfo;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-
-/**
- * aggregates the context, configuraiton and detailed parameters associated with the request into a single structure.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "cloudConfiguration",
- "modelInfo",
- "relatedModelList",
- "requestInfo",
- "subscriberInfo",
- "requestParameters"
-})
-public class RequestDetails extends org.openecomp.vid.domain.mso.RequestDetails {
-
- /** The cloud configuration. */
- @JsonProperty("cloudConfiguration")
- private CloudConfiguration cloudConfiguration;
-
- /** The model info. */
- @JsonProperty("modelInfo")
- private ModelInfo modelInfo;
-
- /** The related model list. */
- @JsonProperty("relatedModelList")
- private List<RelatedModel> relatedInstanceList;
-
- /** The request info. */
- @JsonProperty("requestInfo")
- private RequestInfo requestInfo;
-
- /** The subscriber info. */
- @JsonProperty("subscriberInfo")
- private SubscriberInfo subscriberInfo;
-
- /** The request parameters. */
- @JsonProperty("requestParameters")
- private RequestParameters requestParameters;
-
- /** The additional properties. */
- @JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- /**
- * Gets the cloud configuration.
- *
- * @return The cloudConfiguration
- */
- @JsonProperty("cloudConfiguration")
- public CloudConfiguration getCloudConfiguration() {
- return cloudConfiguration;
- }
-
- /**
- * Sets the cloud configuration.
- *
- * @param cloudConfiguration The cloudConfiguration
- */
- @JsonProperty("cloudConfiguration")
- public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
- this.cloudConfiguration = cloudConfiguration;
- }
-
- /**
- * Gets the model info.
- *
- * @return The modelInfo
- */
- @JsonProperty("modelInfo")
- public ModelInfo getModelInfo() {
- return modelInfo;
- }
-
- /**
- * Sets the model info.
- *
- * @param modelInfo The modelInfo
- */
- @JsonProperty("modelInfo")
- public void setModelInfo(ModelInfo modelInfo) {
- this.modelInfo = modelInfo;
- }
- /**
- * Gets the related instance list.
- *
- * @return The relatedInstanceList
- */
- @JsonProperty("relatedInstanceList")
- public List<RelatedModel> getRelatedInstanceList() {
- return relatedInstanceList;
- }
-
- /**
- * Sets the related model list.
- *
- * @param relatedInstanceList The relatedInstanceList
- */
- @JsonProperty("relatedInstanceList")
- public void setRelatedInstanceList( List<RelatedModel> relatedInstanceList) {
- this.relatedInstanceList = relatedInstanceList;
- }
-
- /**
- * Gets the request info.
- *
- * @return The requestInfo
- */
- @JsonProperty("requestInfo")
- public RequestInfo getRequestInfo() {
- return requestInfo;
- }
-
- /**
- * Sets the request info.
- *
- * @param requestInfo The requestInfo
- */
- @JsonProperty("requestInfo")
- public void setRequestInfo(RequestInfo requestInfo) {
- this.requestInfo = requestInfo;
- }
-
- /**
- * Gets the subscriber info.
- *
- * @return The subscriberInfo
- */
- @JsonProperty("subscriberInfo")
- public SubscriberInfo getSubscriberInfo() {
- return subscriberInfo;
- }
-
- /**
- * Sets the subscriber info.
- *
- * @param subscriberInfo The subscriberInfo
- */
- @JsonProperty("subscriberInfo")
- public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
- this.subscriberInfo = subscriberInfo;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RequestDetails#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RequestDetails#getAdditionalProperties()
- */
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RequestDetails#setAdditionalProperty(java.lang.String, java.lang.Object)
- */
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RequestDetails#hashCode()
- */
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(cloudConfiguration).append(modelInfo).append(relatedInstanceList).append(requestInfo).append(getRequestParameters()).append(subscriberInfo).append(additionalProperties).toHashCode();
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.domain.mso.RequestDetails#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof RequestDetails) == false) {
- return false;
- }
- RequestDetails rhs = ((RequestDetails) other);
- return new EqualsBuilder().append(cloudConfiguration, rhs.cloudConfiguration).append(modelInfo, rhs.modelInfo).append(relatedInstanceList, rhs.relatedInstanceList).append(requestInfo, rhs.requestInfo).append(getRequestParameters(), rhs.getRequestParameters()).append(subscriberInfo, rhs.subscriberInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.List;
+
+import org.onap.vid.domain.mso.*;
+import org.onap.vid.domain.mso.SubscriberInfo;
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+
+
+/**
+ * aggregates the context, configuraiton and detailed parameters associated with the request into a single structure.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@JsonPropertyOrder({
+ "cloudConfiguration",
+ "modelInfo",
+ "relatedModelList",
+ "requestInfo",
+ "subscriberInfo",
+ "requestParameters"
+})
+public class RequestDetails{
+
+ /** The cloud configuration. */
+ @JsonProperty("cloudConfiguration")
+ private CloudConfiguration cloudConfiguration;
+
+ /** The model info. */
+ @JsonProperty("modelInfo")
+ private ModelInfo modelInfo;
+
+ /** The related model list. */
+ @JsonProperty("relatedModelList")
+ private List<RelatedModel> relatedInstanceList;
+
+ /** The request info. */
+ @JsonProperty("requestInfo")
+ private RequestInfo requestInfo;
+
+ /** The subscriber info. */
+ @JsonProperty("subscriberInfo")
+ private SubscriberInfo subscriberInfo;
+
+ /** The request parameters. */
+ @JsonProperty("requestParameters")
+ private RequestParameters requestParameters;
+
+ /** The additional properties. */
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ /**
+ * Gets the cloud configuration.
+ *
+ * @return The cloudConfiguration
+ */
+ @JsonProperty("cloudConfiguration")
+ public CloudConfiguration getCloudConfiguration() {
+ return cloudConfiguration;
+ }
+
+ /**
+ * Sets the cloud configuration.
+ *
+ * @param cloudConfiguration The cloudConfiguration
+ */
+ @JsonProperty("cloudConfiguration")
+ public void setCloudConfiguration(CloudConfiguration cloudConfiguration) {
+ this.cloudConfiguration = cloudConfiguration;
+ }
+
+ /**
+ * Gets the model info.
+ *
+ * @return The modelInfo
+ */
+ @JsonProperty("modelInfo")
+ public ModelInfo getModelInfo() {
+ return modelInfo;
+ }
+
+ /**
+ * Sets the model info.
+ *
+ * @param modelInfo The modelInfo
+ */
+ @JsonProperty("modelInfo")
+ public void setModelInfo(ModelInfo modelInfo) {
+ this.modelInfo = modelInfo;
+ }
+ /**
+ * Gets the related instance list.
+ *
+ * @return The relatedInstanceList
+ */
+ @JsonProperty("relatedInstanceList")
+ public List<RelatedModel> getRelatedInstanceList() {
+ return relatedInstanceList;
+ }
+
+ /**
+ * Sets the related model list.
+ *
+ * @param relatedInstanceList The relatedInstanceList
+ */
+ @JsonProperty("relatedInstanceList")
+ public void setRelatedInstanceList( List<RelatedModel> relatedInstanceList) {
+ this.relatedInstanceList = relatedInstanceList;
+ }
+
+ /**
+ * Gets the request info.
+ *
+ * @return The requestInfo
+ */
+ @JsonProperty("requestInfo")
+ public RequestInfo getRequestInfo() {
+ return requestInfo;
+ }
+
+ /**
+ * Sets the request info.
+ *
+ * @param requestInfo The requestInfo
+ */
+ @JsonProperty("requestInfo")
+ public void setRequestInfo(RequestInfo requestInfo) {
+ this.requestInfo = requestInfo;
+ }
+
+ /**
+ * Gets the subscriber info.
+ *
+ * @return The subscriberInfo
+ */
+ @JsonProperty("subscriberInfo")
+ public SubscriberInfo getSubscriberInfo() {
+ return subscriberInfo;
+ }
+
+ /**
+ * Sets the subscriber info.
+ *
+ * @param subscriberInfo The subscriberInfo
+ */
+ @JsonProperty("subscriberInfo")
+ public void setSubscriberInfo(SubscriberInfo subscriberInfo) {
+ this.subscriberInfo = subscriberInfo;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RequestDetails#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RequestDetails#getAdditionalProperties()
+ */
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RequestDetails#setAdditionalProperty(java.lang.String, java.lang.Object)
+ */
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RequestDetails#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(cloudConfiguration).append(modelInfo).append(relatedInstanceList).append(requestInfo).append(getRequestParameters()).append(subscriberInfo).append(additionalProperties).toHashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see org.openecomp.vid.domain.mso.RequestDetails#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RequestDetails) == false) {
+ return false;
+ }
+ RequestDetails rhs = ((RequestDetails) other);
+ return new EqualsBuilder().append(cloudConfiguration, rhs.cloudConfiguration).append(modelInfo, rhs.modelInfo).append(relatedInstanceList, rhs.relatedInstanceList).append(requestInfo, rhs.requestInfo).append(getRequestParameters(), rhs.getRequestParameters()).append(subscriberInfo, rhs.subscriberInfo).append(additionalProperties, rhs.additionalProperties).isEquals();
+ }
+
+ public RequestParameters getRequestParameters() {
+ return requestParameters;
+ }
+
+ public void setRequestParameters(RequestParameters requestParameters) {
+ this.requestParameters = requestParameters;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
index 8a57c74b7..8f8272c07 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestList.java
@@ -1,137 +1,137 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import javax.annotation.Generated;
-
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-//import com.fasterxml.jackson.annotation.JsonInclude;
-//import com.fasterxml.jackson.annotation.JsonProperty;
-//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-import java.util.List;
-
-/**
- * List of relatedModel structures that are related to a modelInfo being operated on.
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@Generated("org.jsonschema2pojo")
-@JsonPropertyOrder({
- "finishTime",
- "instanceIds",
- "requestDetails",
- "requestId",
- "requestScope",
- "requestStatus",
- "requestType",
- "startTime"
-})
-
-public class RequestList {
-
- /** The request list. */
- private List<RequestWrapper> requestList;
-
- /** The additional properties. */
- @JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- /**
- * (Required).
- *
- * @return The RelatedModel List
- */
- public List<RequestWrapper> getRequestList() {
- return requestList;
- }
-
- /**
- * Sets the request list.
- *
- * @param l the new request list
- */
- public void setRequestList(List<RequestWrapper> l) {
- this.requestList = l;
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- /**
- * Gets the additional properties.
- *
- * @return the additional properties
- */
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- /**
- * Sets the additional property.
- *
- * @param name the name
- * @param value the value
- */
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#hashCode()
- */
- @Override
- public int hashCode() {
- return new HashCodeBuilder().append(getRequestList()).append(additionalProperties).toHashCode();
- }
-
- /* (non-Javadoc)
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object other) {
- if (other == this) {
- return true;
- }
- if ((other instanceof RequestList) == false) {
- return false;
- }
- RequestList rhs = ((RequestList) other);
- return new EqualsBuilder().append(getRequestList(), rhs.getRequestList()).append(additionalProperties, rhs.additionalProperties).isEquals();
- }
-
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.mso.rest;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.annotation.Generated;
+
+import com.fasterxml.jackson.annotation.JsonAnyGetter;
+import com.fasterxml.jackson.annotation.JsonAnySetter;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonInclude;
+import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+
+//import com.fasterxml.jackson.annotation.JsonInclude;
+//import com.fasterxml.jackson.annotation.JsonProperty;
+//import com.fasterxml.jackson.annotation.JsonPropertyOrder;
+import org.apache.commons.lang.builder.EqualsBuilder;
+import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.commons.lang.builder.ToStringBuilder;
+import java.util.List;
+
+/**
+ * List of relatedModel structures that are related to a modelInfo being operated on.
+ */
+@JsonInclude(JsonInclude.Include.NON_NULL)
+@Generated("org.jsonschema2pojo")
+@JsonPropertyOrder({
+ "finishTime",
+ "instanceIds",
+ "requestDetails",
+ "requestId",
+ "requestScope",
+ "requestStatus",
+ "requestType",
+ "startTime"
+})
+
+public class RequestList {
+
+ /** The request list. */
+ private List<RequestWrapper> requestList;
+
+ /** The additional properties. */
+ @JsonIgnore
+ private Map<String, Object> additionalProperties = new HashMap<String, Object>();
+
+ /**
+ * (Required).
+ *
+ * @return The RelatedModel List
+ */
+ public List<RequestWrapper> getRequestList() {
+ return requestList;
+ }
+
+ /**
+ * Sets the request list.
+ *
+ * @param l the new request list
+ */
+ public void setRequestList(List<RequestWrapper> l) {
+ this.requestList = l;
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#toString()
+ */
+ @Override
+ public String toString() {
+ return ToStringBuilder.reflectionToString(this);
+ }
+
+ /**
+ * Gets the additional properties.
+ *
+ * @return the additional properties
+ */
+ @JsonAnyGetter
+ public Map<String, Object> getAdditionalProperties() {
+ return this.additionalProperties;
+ }
+
+ /**
+ * Sets the additional property.
+ *
+ * @param name the name
+ * @param value the value
+ */
+ @JsonAnySetter
+ public void setAdditionalProperty(String name, Object value) {
+ this.additionalProperties.put(name, value);
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#hashCode()
+ */
+ @Override
+ public int hashCode() {
+ return new HashCodeBuilder().append(getRequestList()).append(additionalProperties).toHashCode();
+ }
+
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ @Override
+ public boolean equals(Object other) {
+ if (other == this) {
+ return true;
+ }
+ if ((other instanceof RequestList) == false) {
+ return false;
+ }
+ RequestList rhs = ((RequestList) other);
+ return new EqualsBuilder().append(getRequestList(), rhs.getRequestList()).append(additionalProperties, rhs.additionalProperties).isEquals();
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
index b0e9fa125..c93d0e563 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RequestWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RequestWrapper.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
index ee3a8bfef..ee074f38d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Response.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Response.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RestInterface.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
index 1e2733587..9fc95fcec 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/RestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/RestInterface.java
@@ -1,6 +1,8 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
-import org.openecomp.vid.mso.RestObject;
+import org.onap.vid.mso.RestObject;
+
+import javax.ws.rs.core.MultivaluedHashMap;
/**
* Created by pickjonathan on 26/06/2017.
@@ -10,7 +12,7 @@ public interface RestInterface {
/**
* Inits the rest client.
*/
- public void initMsoClient();
+ MultivaluedHashMap<String, Object> initMsoClient();
/**
* Gets the.
@@ -22,7 +24,7 @@ public interface RestInterface {
* @param restObject the rest object
* @throws Exception the exception
*/
- public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
+ <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
/**
* Delete.
@@ -35,7 +37,7 @@ public interface RestInterface {
* @param restObject the rest object
* @throws Exception the exception
*/
- public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+ <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
/**
* Post.
@@ -48,8 +50,8 @@ public interface RestInterface {
* @param restObject the rest object
* @throws Exception the exception
*/
- public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
+ <T> void Post(T t, Object r, String sourceID, String path, RestObject<T> restObject) throws Exception;
+
/**
* Put.
*
@@ -61,21 +63,6 @@ public interface RestInterface {
* @param restObject the rest object
* @throws Exception the exception
*/
- public <T> void Put(T t, org.openecomp.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
-
- /***
- * Log request.
- *
- * @param r the r
- */
- public void logRequest ( RequestDetails r );
- /***
- * Log request.
- *
- * @param r the r
- */
- public void logRequest(org.openecomp.vid.changeManagement.RequestDetails r);
-
+ <T> void Put(T t, org.onap.vid.changeManagement.RequestDetailsWrapper r, String sourceID, String path, RestObject<T> restObject) throws Exception;
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
index 8d72890ff..79aaaea51 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/Task.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/Task.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java b/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
index 7232364a3..bbff333af 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/TaskList.java
+++ b/vid-app-common/src/main/java/org/onap/vid/mso/rest/TaskList.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.mso.rest;
+package org.onap.vid.mso.rest;
import java.util.List;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
index d273aa6a7..2afb2d4a7 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyProperties.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
import org.openecomp.portalsdk.core.util.SystemProperties;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
index 02ca0f0ec..d5a4d124c 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyResponseWrapper.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyResponseWrapper.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
index 7c075a535..b58fe28ff 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInt.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInt.java
@@ -18,21 +18,20 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.policy.rest.RequestDetails;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.policy.rest.RequestDetails;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
public class PolicyRestInt {
/** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInt.class);
/** The Constant dateFormat. */
final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
index d6a59da20..875586d99 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterface.java
@@ -1,28 +1,27 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
+import org.apache.commons.codec.binary.Base64;
+import org.eclipse.jetty.util.security.Password;
+import org.json.simple.JSONObject;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.client.HttpBasicClient;
+import org.onap.vid.policy.rest.RequestDetails;
import javax.ws.rs.client.Client;
import javax.ws.rs.client.Entity;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.Response;
-
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.json.simple.JSONObject;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.policy.rest.RequestDetails;
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Collections;
+import java.util.Date;
public class PolicyRestInterface extends PolicyRestInt implements PolicyRestInterfaceIfc {
/** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
+ private static final EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(PolicyRestInterface.class);
/** The Constant dateFormat. */
final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
index 1570875c0..40cb854bf 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceFactory.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceFactory.java
@@ -1,5 +1,5 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
public class PolicyRestInterfaceFactory {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
index f56924b36..59b0ad3dc 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyRestInterfaceIfc.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyRestInterfaceIfc.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
import org.json.simple.JSONObject;
-import org.openecomp.vid.policy.rest.RequestDetails;
+import org.onap.vid.policy.rest.RequestDetails;
public interface PolicyRestInterfaceIfc {
/**
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
index ceda7c427..608352845 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/PolicyUtil.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/PolicyUtil.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
@@ -6,9 +6,9 @@ import java.util.Date;
import org.glassfish.jersey.client.ClientResponse;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.policy.PolicyResponseWrapper;
-import org.openecomp.vid.policy.PolicyUtil;
-import org.openecomp.vid.policy.RestObject;
+import org.onap.vid.policy.PolicyResponseWrapper;
+import org.onap.vid.policy.PolicyUtil;
+import org.onap.vid.policy.RestObject;
import com.fasterxml.jackson.databind.ObjectMapper;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
index de085f24b..81b354eb0 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/RestObject.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.policy;
+package org.onap.vid.policy;
/**
* The Class RestObject.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
index 93e80d6b3..81e2f2d8b 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/policy/rest/RequestDetails.java
+++ b/vid-app-common/src/main/java/org/onap/vid/policy/rest/RequestDetails.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.policy.rest;
+package org.onap.vid.policy.rest;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
index 232023b4e..c767967f1 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/AsdcClientConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/AsdcClientConfiguration.java
@@ -1,124 +1,124 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.properties;
-
-import org.springframework.beans.factory.annotation.Value;
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.context.annotation.PropertySource;
-import org.springframework.context.annotation.PropertySources;
-import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
-
-/**
- * The Class AsdcClientConfiguration.
- */
-@Configuration
-
-@PropertySources({
- @PropertySource(value="asdc.properties", ignoreResourceNotFound = true),
- @PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties", ignoreResourceNotFound = true)
-})
-public class AsdcClientConfiguration {
-
- @Bean
- public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
- return new PropertySourcesPlaceholderConfigurer();
- }
-
- @Value("${asdc.client.type}")
- private AsdcClientType asdcClientType;
-
- /** The asdc client host. */
- @Value("${asdc.client.rest.host}")
- private String asdcClientHost;
-
- /** The asdc client port. */
- @Value("${asdc.client.rest.port}")
- private int asdcClientPort;
-
- /** The asdc client auth. */
- @Value("${asdc.client.rest.auth}")
- public String asdcClientAuth;
-
- /** The asdc client protocol. */
- @Value("${asdc.client.rest.protocol}")
- public String asdcClientProtocol;
-
- /**
- * Gets the asdc client type.
- *
- * @return the asdc client type
- */
- public AsdcClientType getAsdcClientType() {
- return asdcClientType;
- }
-
- /**
- * Gets the asdc client host.
- *
- * @return the asdc client host
- */
- public String getAsdcClientHost() {
- return asdcClientHost;
- }
-
- /**
- * Gets the asdc client port.
- *
- * @return the asdc client port
- */
- public int getAsdcClientPort() {
- return asdcClientPort;
- }
-
- /**
- * Gets the asdc client auth.
- *
- * @return the asdc client auth
- */
- public String getAsdcClientAuth() {
- return asdcClientAuth;
- }
-
- /**
- * Gets the asdc client protocol.
- *
- * @return the asdc client protocol
- */
- public String getAsdcClientProtocol() {
- return asdcClientProtocol;
- }
-
- /**
- * The Enum AsdcClientType.
- */
- public enum AsdcClientType {
-
- /** The in memory. */
- IN_MEMORY,
-
- /** The rest. */
- REST,
-
- /** The local. */
- LOCAL
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.properties;
+
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.PropertySource;
+import org.springframework.context.annotation.PropertySources;
+import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
+
+/**
+ * The Class AsdcClientConfiguration.
+ */
+@Configuration
+
+@PropertySources({
+ @PropertySource(value="asdc.properties", ignoreResourceNotFound = true),
+ @PropertySource(value="${container.classpath:}/WEB-INF/conf/asdc.properties", ignoreResourceNotFound = true)
+})
+public class AsdcClientConfiguration {
+
+ @Bean
+ public static PropertySourcesPlaceholderConfigurer propertySourcesPlaceholderConfigurer() {
+ return new PropertySourcesPlaceholderConfigurer();
+ }
+
+ @Value("${asdc.client.type}")
+ private AsdcClientType asdcClientType;
+
+ /** The asdc client host. */
+ @Value("${asdc.client.rest.host}")
+ private String asdcClientHost;
+
+ /** The asdc client port. */
+ @Value("${asdc.client.rest.port}")
+ private int asdcClientPort;
+
+ /** The asdc client auth. */
+ @Value("${asdc.client.rest.auth}")
+ public String asdcClientAuth;
+
+ /** The asdc client protocol. */
+ @Value("${asdc.client.rest.protocol}")
+ public String asdcClientProtocol;
+
+ /**
+ * Gets the asdc client type.
+ *
+ * @return the asdc client type
+ */
+ public AsdcClientType getAsdcClientType() {
+ return asdcClientType;
+ }
+
+ /**
+ * Gets the asdc client host.
+ *
+ * @return the asdc client host
+ */
+ public String getAsdcClientHost() {
+ return asdcClientHost;
+ }
+
+ /**
+ * Gets the asdc client port.
+ *
+ * @return the asdc client port
+ */
+ public int getAsdcClientPort() {
+ return asdcClientPort;
+ }
+
+ /**
+ * Gets the asdc client auth.
+ *
+ * @return the asdc client auth
+ */
+ public String getAsdcClientAuth() {
+ return asdcClientAuth;
+ }
+
+ /**
+ * Gets the asdc client protocol.
+ *
+ * @return the asdc client protocol
+ */
+ public String getAsdcClientProtocol() {
+ return asdcClientProtocol;
+ }
+
+ /**
+ * The Enum AsdcClientType.
+ */
+ public enum AsdcClientType {
+
+ /** The in memory. */
+ IN_MEMORY,
+
+ /** The rest. */
+ REST,
+
+ /** The local. */
+ LOCAL
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java b/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
index f7a331a7e..ca58a954d 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/MsoClientConfiguration.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/MsoClientConfiguration.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.properties;
+package org.onap.vid.properties;
/**
* Created by pickjonathan on 20/06/2017.
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
index 141b9b27c..9108ae16c 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/properties/VidProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java
@@ -1,93 +1,93 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.properties;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import org.openecomp.vid.model.ModelConstants;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-import org.openecomp.vid.controller.VidController;
-/**
- * The Class VidProperties.
- */
-public class VidProperties extends SystemProperties {
-
- //VID General Properties
-
- /** The Constant VID_TRUSTSTORE_FILENAME. */
- public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
-
- /** The Constant VID_TRUSTSTORE_PASSWD_X. */
- public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
-
- /** The Constant FILESEPARATOR. */
- public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
-
- /** The Constant LOG. */
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidController.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
- /**
- * Gets the asdc model namespace prefix property
- *
- * @return the property value or a default value
- */
- public static String getAsdcModelNamespace() {
- String methodName = "getAsdcModelNamespace ";
- String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
- try {
- asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);
- if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) {
- asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
- }
- }
- catch ( Exception e ) {
- LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
- + ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE);
- asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
- }
- return (asdcModelNamespace);
- }
- /**
- * Gets the specified property value. If the property is not defined, returns a default value.
- *
- * @return the property value or a default value
- */
- public static String getPropertyWithDefault ( String propName, String defaultValue ) {
- String methodName = "getPropertyWithDefault ";
- String propValue = defaultValue;
- try {
- propValue = SystemProperties.getProperty(propName);
- if ( propValue == null || propValue.isEmpty()) {
- propValue = defaultValue;
- }
- }
- catch ( Exception e ) {
- LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
- + defaultValue);
- propValue = defaultValue;
- }
- return (propValue);
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+package org.onap.vid.properties;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.model.ModelConstants;
+
+import java.text.DateFormat;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+/**
+ * The Class VidProperties.
+ */
+public class VidProperties extends SystemProperties {
+
+ //VID General Properties
+
+ /** The Constant VID_TRUSTSTORE_FILENAME. */
+ public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename";
+
+ /** The Constant VID_TRUSTSTORE_PASSWD_X. */
+ public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x";
+
+ /** The Constant FILESEPARATOR. */
+ public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator");
+
+ /** The Constant LOG. */
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidProperties.class);
+
+ /** The Constant dateFormat. */
+ final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
+ /**
+ * Gets the asdc model namespace prefix property
+ *
+ * @return the property value or a default value
+ */
+ public static String getAsdcModelNamespace() {
+ String methodName = "getAsdcModelNamespace ";
+ String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+ try {
+ asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE);
+ if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) {
+ asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+ }
+ }
+ catch ( Exception e ) {
+ LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
+ + ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE);
+ asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE;
+ }
+ return (asdcModelNamespace);
+ }
+ /**
+ * Gets the specified property value. If the property is not defined, returns a default value.
+ *
+ * @return the property value or a default value
+ */
+ public static String getPropertyWithDefault ( String propName, String defaultValue ) {
+ String methodName = "getPropertyWithDefault ";
+ String propValue = defaultValue;
+ try {
+ propValue = SystemProperties.getProperty(propName);
+ if ( propValue == null || propValue.isEmpty()) {
+ propValue = defaultValue;
+ }
+ }
+ catch ( Exception e ) {
+ LOG.error (EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodName + "unable to find the value, using the default "
+ + defaultValue);
+ propValue = defaultValue;
+ }
+ return (propValue);
+ }
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/EcompRole.java b/vid-app-common/src/main/java/org/onap/vid/roles/EcompRole.java
index 5242f5aaa..63492cd97 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/EcompRole.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/EcompRole.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.roles;
+package org.onap.vid.roles;
public enum EcompRole {
READ;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java
index f818e48fa..902da5bcd 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/Role.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/Role.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.roles;
+package org.onap.vid.roles;
/**
* Created by Oren on 7/1/17.
@@ -14,9 +14,9 @@ public class Role {
private String tenant;
- public Role(EcompRole ecompRole, String serviceName, String serviceType, String tenant) {
+ public Role(EcompRole ecompRole, String subscribeName, String serviceType, String tenant) {
this.ecompRole = ecompRole;
- this.subscribeName = serviceName;
+ this.subscribeName = subscribeName;
this.serviceType = serviceType;
this.tenant = tenant;
}
diff --git a/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
new file mode 100644
index 000000000..63cc2bbb0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleProvider.java
@@ -0,0 +1,138 @@
+package org.onap.vid.roles;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.web.support.UserUtils;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.exceptions.RoleParsingException;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.model.Subscriber;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.services.AaiService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import javax.annotation.PostConstruct;
+import javax.servlet.http.HttpServletRequest;
+import java.util.*;
+
+//import org.codehaus.jackson.map.ObjectMapper;
+
+/**
+ * Created by Oren on 7/1/17.
+ */
+
+@Component
+public class RoleProvider {
+
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RoleProvider.class);
+ final String readPermissionString = "read";
+ SubscriberList subscribers;
+ ObjectMapper om = new ObjectMapper();
+ @Autowired
+ private AaiService aaiService;
+
+ public static List<String> extractRoleFromSession(HttpServletRequest request) {
+
+ return new ArrayList<String>();
+
+ }
+
+ @PostConstruct
+ public void init() {
+ LOG.debug(EELFLoggerDelegate.debugLogger, "Role provider => init method started");
+ AaiResponse<SubscriberList> subscribersResponse = aaiService.getFullSubscriberList();
+ subscribers = subscribersResponse.getT();
+ LOG.debug(EELFLoggerDelegate.debugLogger, "Role provider => init method finished");
+ }
+
+ public List<Role> getUserRoles(HttpServletRequest request) throws JsonProcessingException {
+ String logPrefix = "Role Provider (" + UserUtils.getUserId(request) + ") ==>";
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Entering to get user role for user " + UserUtils.getUserId(request));
+
+ List<Role> roleList = new ArrayList<>();
+ HashMap roles = UserUtils.getRoles(request);
+ for (Object role : roles.keySet()) {
+ org.openecomp.portalsdk.core.domain.Role sdkRol = (org.openecomp.portalsdk.core.domain.Role) roles.get(role);
+
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Role " + sdkRol.getName() + " is being proccessed");
+ try {
+ if (sdkRol.getName().contains(readPermissionString)) {
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + " Role " + sdkRol.getName() + " contain " + readPermissionString);
+
+ continue;
+ }
+ String[] roleParts = splitRole((sdkRol.getName()), logPrefix);
+ roleList.add(createRoleFromStringArr(roleParts, logPrefix));
+ String msg = String.format(logPrefix + " User %s got permissions %s", UserUtils.getUserId(request), Arrays.toString(roleParts));
+ LOG.debug(EELFLoggerDelegate.debugLogger, msg);
+ } catch (RoleParsingException e) {
+ LOG.error(logPrefix + " Failed to parse permission");
+
+ }
+ }
+
+ return roleList;
+ }
+
+ public String[] splitRole(String roleAsString, String logPrefix) {
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Spliting role = " + roleAsString + "With delimeter = " + ModelConstants.ROLE_DELIMITER);
+ return roleAsString.split(ModelConstants.ROLE_DELIMITER);
+ }
+
+ public boolean userPermissionIsReadOnly(List<Role> roles) {
+
+ return (!(roles.size() > 0));
+ }
+
+ public boolean userPermissionIsReadLogs(List<Role> roles){
+ for(Role role: roles){
+ if(role.getServiceType().equals("LOGS")){
+ if(role.getTenant().equals("PERMITTED")){
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+
+ private String replaceSubscriberNameToGlobalCustomerID(String subscriberName, String logPrefix) throws JsonProcessingException {
+ if (subscribers == null) {
+ LOG.debug(EELFLoggerDelegate.debugLogger, "replaceSubscriberNameToGlobalCustomerID calling init method");
+ init();
+ }
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "subscribers list size is " + subscribers.customer.size() + " with the values " + om.writeValueAsString(subscribers.customer));
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "subscribers list size is " + subscribers.customer.size() + " with the values " + om.writeValueAsString(subscribers.customer));
+
+
+ Optional<Subscriber> s = subscribers.customer.stream().filter(x -> x.subscriberName.equals(subscriberName)).findFirst();
+ //Fixing bug of logging "optional get" before isPresent
+ String replacement = s.isPresent() ? s.get().globalCustomerId : "";
+ LOG.debug(EELFLoggerDelegate.debugLogger, logPrefix + "Subscribername " + subscriberName + " changed to " + replacement);
+ return replacement;
+ }
+
+ public Role createRoleFromStringArr(String[] roleParts, String rolePrefix) throws JsonProcessingException, RoleParsingException {
+ String globalCustomerID = replaceSubscriberNameToGlobalCustomerID(roleParts[0], rolePrefix);
+ try {
+ if (roleParts.length > 2) {
+ return new Role(EcompRole.READ, globalCustomerID, roleParts[1], roleParts[2]);
+ } else {
+ return new Role(EcompRole.READ, globalCustomerID, roleParts[1], null);
+ }
+ } catch (ArrayIndexOutOfBoundsException e) {
+ if (roleParts.length > 0)
+ LOG.debug(EELFLoggerDelegate.debugLogger, "Could not parse role ", roleParts[0]);
+ else {
+ LOG.debug(EELFLoggerDelegate.debugLogger, "Got empty role, Could not parse it ");
+
+ }
+ throw new RoleParsingException();
+ }
+
+ }
+
+}
+
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
index 9031524d3..f4f17facb 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleValidator.java
+++ b/vid-app-common/src/main/java/org/onap/vid/roles/RoleValidator.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.roles;
+package org.onap.vid.roles;
-import org.openecomp.vid.mso.rest.RequestDetails;
+import org.onap.vid.mso.rest.RequestDetails;
import java.util.List;
import java.util.Map;
@@ -10,8 +10,6 @@ import java.util.Map;
*/
public class RoleValidator {
- //Disable roles until AAF integration finishes
- private boolean disableRoles = true;
private List<Role> userRoles;
public RoleValidator(List<Role> roles) {
@@ -19,8 +17,6 @@ public class RoleValidator {
}
public boolean isSubscriberPermitted(String subscriberName) {
- if(this.disableRoles) return true;
-
for (Role role : userRoles) {
if (role.getSubscribeName().equals(subscriberName))
return true;
@@ -29,8 +25,6 @@ public class RoleValidator {
}
public boolean isServicePermitted(String subscriberName, String serviceType) {
- if(this.disableRoles) return true;
-
for (Role role : userRoles) {
if (role.getSubscribeName().equals(subscriberName) && role.getServiceType().equals(serviceType))
return true;
@@ -39,8 +33,6 @@ public class RoleValidator {
}
public boolean isMsoRequestValid(RequestDetails mso_request) {
- if(this.disableRoles) return true;
-
try {
String globalSubscriberIdRequested = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("subscriberInfo")).get("globalSubscriberId");
String serviceType = (String) ((Map) ((Map) mso_request.getAdditionalProperties().get("requestDetails")).get("requestParameters")).get("subscriptionServiceType");
@@ -52,13 +44,11 @@ public class RoleValidator {
// return false;
}
- public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenant) {
- if(this.disableRoles) return true;
-
+ public boolean isTenantPermitted(String globalCustomerId, String serviceType, String tenantName) {
for (Role role : userRoles) {
if (role.getSubscribeName().equals(globalCustomerId)
&& role.getServiceType().equals(serviceType)
- && (role.getTenant() == null || role.getTenant().equals(tenant))) {
+ && (role.getTenant() == null || role.getTenant().equalsIgnoreCase(tenantName))) {
return true;
}
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
index 57b36830e..4accb55da 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObject.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
public class RestObject<T> {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
index 2d0eec74d..ff1ffb4c5 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/RestObject.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/RestObjects/RestObject.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.scheduler.RestObjects;
+package org.onap.vid.scheduler.RestObjects;
public class RestObject<T> {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerProperties.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerProperties.java
index 15855b7be..bb5f6ebb4 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerProperties.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerProperties.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
import org.openecomp.portalsdk.core.util.SystemProperties;
@@ -10,15 +10,10 @@ public class SchedulerProperties extends SystemProperties {
public static final String SCHEDULER_PASSWORD_VAL = "scheduler.password";
public static final String SCHEDULER_SERVER_URL_VAL = "scheduler.server.url";
-
- public static final String SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL = "scheduler.create.new.vnf.change.instance";
-
- public static final String SCHEDULER_GET_TIME_SLOTS = "scheduler.get.time.slots";
-
- public static final String SCHEDULER_SUBMIT_NEW_VNF_CHANGE = "scheduler.submit.new.vnf.change";
public static final String SCHEDULER_GET_SCHEDULES = "scheduler.get.schedules";
- public static final String GET_VERSION_BY_INVARIANT_ID = "aai_get_version_by_invariant_id";
+ public static final String SCHEDULER_DELETE_SCHEDULE = "scheduler.delete.schedule";
+
}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
index 5f529f390..2077e7a40 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterface.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterface.java
@@ -1,4 +1,4 @@
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
import java.util.Collections;
import javax.ws.rs.client.Client;
@@ -12,12 +12,15 @@ import org.eclipse.jetty.util.security.Password;
import org.json.simple.JSONObject;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.client.HttpsBasicClient;
-import org.openecomp.vid.scheduler.SchedulerProperties;
-import org.openecomp.vid.scheduler.RestObjects.RestObject;
+import org.onap.vid.client.HttpBasicClient;
+import org.onap.vid.client.HttpsBasicClient;
+import org.onap.vid.scheduler.SchedulerProperties;
+import org.onap.vid.scheduler.RestObjects.RestObject;
import org.springframework.stereotype.Service;
+import static org.onap.vid.utils.Logging.getHttpServletRequest;
+import static org.onap.vid.utils.Logging.requestIdHeaderKey;
+
@Service
public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
@@ -84,7 +87,7 @@ public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
}
@SuppressWarnings("unchecked")
- public <T> void Get (T t, String sourceId, String path, org.openecomp.vid.scheduler.RestObject<T> restObject ) throws Exception {
+ public <T> void Get (T t, String sourceId, String path, org.onap.vid.scheduler.RestObject<T> restObject ) throws Exception {
String methodName = "Get";
String url = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SERVER_URL_VAL) + path;
@@ -98,7 +101,8 @@ public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
.request()
.accept("application/json")
.headers(commonHeaders)
- .get();
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .get();
int status = cres.getStatus();
restObject.setStatusCode (status);
@@ -131,7 +135,8 @@ public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
.request()
.accept("application/json")
.headers(commonHeaders)
- .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
+ .post(Entity.entity(requestDetails, MediaType.APPLICATION_JSON));
try {
t = (T) cres.readEntity(t.getClass());
@@ -164,7 +169,7 @@ public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
public void logRequest(JSONObject requestDetails) {}
@SuppressWarnings("unchecked")
- public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject) {
+ public <T> void Delete(T t, String sourceID, String path, org.onap.vid.scheduler.RestObject<T> restObject) {
String url="";
Response cres = null;
@@ -178,8 +183,9 @@ public class SchedulerRestInterface implements SchedulerRestInterfaceIfc {
.request()
.accept("application/json")
.headers(commonHeaders)
+ .header(requestIdHeaderKey, getHttpServletRequest().getHeader(requestIdHeaderKey))
//.entity(r)
- .build("DELETE", Entity.entity(requestDetails, MediaType.APPLICATION_JSON)).invoke();
+ .delete();
// .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
//.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
index bf7bd8891..1c3bea9f5 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceFactory.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceFactory.java
@@ -1,5 +1,5 @@
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
public class SchedulerRestInterfaceFactory {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceIfc.java b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceIfc.java
index 839ab348d..7be8480ff 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInterfaceIfc.java
+++ b/vid-app-common/src/main/java/org/onap/vid/scheduler/SchedulerRestInterfaceIfc.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.scheduler;
+package org.onap.vid.scheduler;
import org.json.simple.JSONObject;
-import org.openecomp.vid.scheduler.RestObjects.RestObject;
+import org.onap.vid.scheduler.RestObjects.RestObject;
import org.springframework.stereotype.Service;
@Service
@@ -10,12 +10,14 @@ public interface SchedulerRestInterfaceIfc {
public void initRestClient();
- public <T> void Get (T t, String sourceId, String path, org.openecomp.vid.scheduler.RestObject<T> restObject ) throws Exception;
+ public <T> void Get (T t, String sourceId, String path, org.onap.vid.scheduler.RestObject<T> restObject ) throws Exception;
- public <T> void Delete(T t, JSONObject requestDetails, String sourceID, String path, RestObject<T> restObject)
+ public <T> void Delete(T t, String sourceID, String path, org.onap.vid.scheduler.RestObject<T> restObject)
throws Exception;
public <T> void Post(T t, JSONObject r, String path, RestObject<T> restObject) throws Exception;
public void logRequest(JSONObject requestDetails);
-} \ No newline at end of file
+}
+
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AaiService.java b/vid-app-common/src/main/java/org/onap/vid/services/AaiService.java
new file mode 100644
index 000000000..4e86281c6
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/AaiService.java
@@ -0,0 +1,63 @@
+package org.onap.vid.services;
+
+import org.codehaus.jackson.JsonParseException;
+import org.codehaus.jackson.map.JsonMappingException;
+import org.onap.vid.aai.AaiResponse;
+import org.onap.vid.aai.SubscriberFilteredResults;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceInstanceSearchResult;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+
+import javax.ws.rs.core.Response;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public interface AaiService {
+
+
+ SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator);
+
+ AaiResponse getSubscriberData(String subscriberId, RoleValidator roleValidator);
+
+ AaiResponse getServiceInstanceSearchResults(String subscriberId, String instanceIdentifier, RoleValidator roleProvider, List<String> owningEntities, List<String> projects);
+
+ AaiResponse<SubscriberList> getFullSubscriberList();
+
+ AaiResponse getServices(RoleValidator roleValidator);
+
+ AaiResponse getAaiZones();
+
+ AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus);
+
+ AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
+
+ Response getVNFData(String globalSubscriberId, String serviceType);
+
+ AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator);
+
+ AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
+
+ AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion);
+
+ Response getVersionByInvariantId(List<String> modelInvariantId);
+
+ Collection<Service> getServicesByDistributionStatus();
+
+ AaiResponse<Pnf> getSpecificPnf(String pnfId);
+
+ List<String> getServiceInstanceAssociatedPnfs(String globalCustomerId, String serviceType, String serviceInstanceId);
+
+ AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel);
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
new file mode 100644
index 000000000..ffb43803c
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/AaiServiceImpl.java
@@ -0,0 +1,435 @@
+package org.onap.vid.services;
+
+import org.apache.http.HttpStatus;
+import org.onap.vid.aai.model.AaiGetAicZone.AicZones;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.onap.vid.aai.*;
+import org.onap.vid.aai.ServiceInstance;
+import org.onap.vid.aai.ServiceSubscription;
+import org.onap.vid.aai.Services;
+import org.onap.vid.aai.model.AaiGetOperationalEnvironments.OperationalEnvironmentList;
+import org.onap.vid.aai.model.AaiGetPnfs.Pnf;
+import org.onap.vid.aai.model.AaiGetServicesRequestModel.GetServicesAAIRespone;
+import org.onap.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
+import org.onap.vid.aai.model.*;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceInstanceSearchResult;
+import org.onap.vid.model.SubscriberList;
+import org.onap.vid.roles.RoleValidator;
+import org.onap.vid.utils.Intersection;
+import org.springframework.beans.factory.annotation.Autowired;
+
+import javax.ws.rs.core.Response;
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Created by Oren on 7/4/17.
+ */
+public class AaiServiceImpl implements AaiService {
+ private String serviceInstanceId = "service-instance.service-instance-id";
+ private String serviceType = "service-subscription.service-type";
+ private String customerId = "customer.global-customer-id";
+ private String serviceInstanceName = "service-instance.service-instance-name";
+ private int indexOfSubscriberName = 6;
+
+ @Autowired
+ private AaiClientInterface aaiClient;
+
+ EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(AaiServiceImpl.class);
+
+ private List<Service> convertModelToService(Model model) {
+ List<Service> services = new ArrayList<>();
+ String category = "";
+
+ if(validateModel(model)){
+ if(model.getModelType() != null)
+ category = model.getModelType();
+
+ for (ModelVer modelVer: model.getModelVers().getModelVer()) {
+ Service service = new Service();
+ if (modelVer.getModelVersionId() != null)
+ service.setUuid(modelVer.getModelVersionId());
+ if(model.getModelInvariantId() != null)
+ service.setInvariantUUID(model.getModelInvariantId());
+ if(modelVer.getModelVersion() != null)
+ service.setVersion(modelVer.getModelVersion());
+ if(modelVer.getModelName() != null)
+ service.setName(modelVer.getModelName());
+ if(modelVer.getDistributionStatus() != null)
+ service.setDistributionStatus(Service.DistributionStatus.valueOf(modelVer.getDistributionStatus()));
+ service.setCategory(category);
+
+ services.add(service);
+ }
+ } else {
+ return null;
+ }
+
+ return services;
+ }
+
+ private boolean validateModel(Model model){
+ if(model != null){
+ if(model.getModelVers() != null && model.getModelVers().getModelVer() != null && model.getModelVers().getModelVer().get(0).getModelVersionId() != null){
+ return true;
+ }
+ }
+ return false;
+ }
+
+ private List<ServiceInstanceSearchResult> getServicesByOwningEntityId(List<String> owningEntities, RoleValidator roleValidator) {
+ AaiResponse<OwningEntityResponse> owningEntityResponse = aaiClient.getServicesByOwningEntityId(owningEntities);
+ List<ServiceInstanceSearchResult> serviceInstanceSearchResultList = new ArrayList<>();
+ if (owningEntityResponse.getT() != null) {
+ for (OwningEntity owningEntity : owningEntityResponse.getT().getOwningEntity()) {
+ if (owningEntity.getRelationshipList() != null) {
+ serviceInstanceSearchResultList = convertRelationshipToSearchResult(owningEntity, serviceInstanceSearchResultList, roleValidator);
+ }
+ }
+ }
+ return serviceInstanceSearchResultList;
+ }
+
+ private List<ServiceInstanceSearchResult> getServicesByProjectNames(List<String> projectNames, RoleValidator roleValidator) {
+ AaiResponse<ProjectResponse> projectByIdResponse = aaiClient.getServicesByProjectNames(projectNames);
+ List<ServiceInstanceSearchResult> serviceInstanceSearchResultList = new ArrayList<>();
+ if (projectByIdResponse.getT() != null) {
+ for (Project project : projectByIdResponse.getT().getProject()) {
+ if (project.getRelationshipList() != null)
+ serviceInstanceSearchResultList = convertRelationshipToSearchResult(project, serviceInstanceSearchResultList, roleValidator);
+ }
+ }
+ return serviceInstanceSearchResultList;
+ }
+
+ private List<ServiceInstanceSearchResult> convertRelationshipToSearchResult(AaiRelationResponse owningEntityResponse, List<ServiceInstanceSearchResult> serviceInstanceSearchResultList, RoleValidator roleValidator) {
+ if (owningEntityResponse.getRelationshipList().getRelationship() != null) {
+ List<Relationship> relationshipList = owningEntityResponse.getRelationshipList().getRelationship();
+ for (Relationship relationship : relationshipList) {
+ ServiceInstanceSearchResult serviceInstanceSearchResult = new ServiceInstanceSearchResult();
+ extractRelationshipData(relationship, serviceInstanceSearchResult, roleValidator);
+ extractRelatedToProperty(relationship, serviceInstanceSearchResult);
+ serviceInstanceSearchResultList.add(serviceInstanceSearchResult);
+ }
+ }
+ return serviceInstanceSearchResultList;
+ }
+
+ private void extractRelationshipData(Relationship relationship, ServiceInstanceSearchResult serviceInstanceSearchResult, RoleValidator roleValidator) {
+ List<RelationshipData> relationshipDataList = relationship.getRelationDataList();
+ if (relationshipDataList != null) {
+ setSubscriberName(relationship, serviceInstanceSearchResult);
+ for (RelationshipData relationshipData : relationshipDataList) {
+ String key = relationshipData.getRelationshipKey();
+ if (key.equals(serviceInstanceId)) {
+ serviceInstanceSearchResult.setServiceInstanceId(relationshipData.getRelationshipValue());
+ } else if (key.equals(serviceType)) {
+ serviceInstanceSearchResult.setServiceType(relationshipData.getRelationshipValue());
+ } else if (key.equals(customerId)) {
+ serviceInstanceSearchResult.setGlobalCustomerId(relationshipData.getRelationshipValue());
+ }
+ }
+
+ boolean isPermitted = roleValidator.isServicePermitted(serviceInstanceSearchResult.getSubscriberName(), serviceInstanceSearchResult.getServiceType());
+ serviceInstanceSearchResult.setIsPermitted(isPermitted);
+ }
+ }
+
+ private void setSubscriberName(Relationship relationship, ServiceInstanceSearchResult serviceInstanceSearchResult) {
+ String relatedLink = relationship.getRelatedLink();
+ String[] subsciber = relatedLink.split("/");
+ serviceInstanceSearchResult.setSubscriberName(subsciber[indexOfSubscriberName]);
+ }
+
+ private void extractRelatedToProperty(Relationship relationship, ServiceInstanceSearchResult serviceInstanceSearchResult) {
+ List<RelatedToProperty> relatedToPropertyList = relationship.getRelatedToPropertyList();
+ if (relatedToPropertyList != null) {
+ for (RelatedToProperty relatedToProperty : relatedToPropertyList) {
+ if (relatedToProperty.getPropertyKey().equals(serviceInstanceName)) {
+ serviceInstanceSearchResult.setServiceInstanceName(relatedToProperty.getPropertyValue());
+ }
+ }
+ }
+ }
+
+ @Override
+ public SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator) {
+ AaiResponse<SubscriberList> subscriberResponse = aaiClient.getAllSubscribers();
+ SubscriberFilteredResults subscriberFilteredResults =
+ new SubscriberFilteredResults(roleValidator, subscriberResponse.getT(),
+ subscriberResponse.getErrorMessage(),
+ subscriberResponse.getHttpCode());
+
+ return subscriberFilteredResults;
+ }
+
+ @Override
+ public AaiResponse<OperationalEnvironmentList> getOperationalEnvironments(String operationalEnvironmentType, String operationalEnvironmentStatus) {
+ AaiResponse<OperationalEnvironmentList> subscriberResponse = aaiClient.getOperationalEnvironments(operationalEnvironmentType, operationalEnvironmentStatus);
+ return subscriberResponse;
+ }
+
+ @Override
+ public AaiResponse<SubscriberList> getFullSubscriberList() {
+ AaiResponse<SubscriberList> subscriberResponse = aaiClient.getAllSubscribers();
+ return subscriberResponse;
+ }
+
+ @Override
+ public AaiResponse getSubscriberData(String subscriberId, RoleValidator roleValidator) {
+ AaiResponse<Services> subscriberResponse = aaiClient.getSubscriberData(subscriberId);
+ String subscriberGlobalId = subscriberResponse.getT().globalCustomerId;
+ for (ServiceSubscription serviceSubscription : subscriberResponse.getT().serviceSubscriptions.serviceSubscription) {
+ String serviceType = serviceSubscription.serviceType;
+ serviceSubscription.isPermitted = roleValidator.isServicePermitted(subscriberGlobalId, serviceType);
+ }
+ return subscriberResponse;
+
+ }
+
+ @Override
+ public AaiResponse getServiceInstanceSearchResults(String subscriberId, String instanceIdentifier, RoleValidator roleValidator, List<String> owningEntities, List<String> projects) {
+ List<List<ServiceInstanceSearchResult>> resultList = new ArrayList<>();
+ ServiceInstancesSearchResults serviceInstancesSearchResults = new ServiceInstancesSearchResults();
+
+ if (subscriberId != null || instanceIdentifier != null) {
+ resultList.add(getServicesBySubscriber(subscriberId, instanceIdentifier, roleValidator));
+ }
+ if (owningEntities != null) {
+ resultList.add(getServicesByOwningEntityId(owningEntities, roleValidator));
+ }
+ if (projects != null) {
+ resultList.add(getServicesByProjectNames(projects, roleValidator));
+ }
+ if (resultList.size() > 0) {
+ Intersection<ServiceInstanceSearchResult> intersection = new Intersection<>();
+ serviceInstancesSearchResults.serviceInstances = intersection.intersectMultipileArray(resultList);
+ }
+
+ return new AaiResponse<>(serviceInstancesSearchResults, null, HttpStatus.SC_OK);
+ }
+
+
+ private List<ServiceInstanceSearchResult> getServicesBySubscriber(String subscriberId, String instanceIdentifier, RoleValidator roleValidator) {
+ AaiResponse<Services> subscriberResponse = aaiClient.getSubscriberData(subscriberId);
+ String subscriberGlobalId = subscriberResponse.getT().globalCustomerId;
+ String subscriberName = subscriberResponse.getT().subscriberName;
+ ServiceSubscriptions serviceSubscriptions = subscriberResponse.getT().serviceSubscriptions;
+
+ return getSearchResultsForSubscriptions(serviceSubscriptions, subscriberId, instanceIdentifier, roleValidator, subscriberGlobalId, subscriberName);
+
+ }
+
+
+ private ArrayList<ServiceInstanceSearchResult> getSearchResultsForSubscriptions(ServiceSubscriptions serviceSubscriptions, String subscriberId, String instanceIdentifier, RoleValidator roleValidator, String subscriberGlobalId, String subscriberName) {
+ ArrayList<ServiceInstanceSearchResult> results = new ArrayList<>();
+
+ if (serviceSubscriptions != null) {
+ for (ServiceSubscription serviceSubscription : serviceSubscriptions.serviceSubscription) {
+ String serviceType = serviceSubscription.serviceType;
+ serviceSubscription.isPermitted = roleValidator.isServicePermitted(subscriberGlobalId, serviceType);
+ ArrayList<ServiceInstanceSearchResult> resultsForSubscription = getSearchResultsForSingleSubscription(serviceSubscription, subscriberId, instanceIdentifier, subscriberName, serviceType);
+ results.addAll(resultsForSubscription);
+ }
+ }
+
+ return results;
+ }
+
+ private ArrayList<ServiceInstanceSearchResult> getSearchResultsForSingleSubscription(ServiceSubscription serviceSubscription, String subscriberId, String instanceIdentifier, String subscriberName, String serviceType) {
+ ArrayList<ServiceInstanceSearchResult> results = new ArrayList<>();
+
+ if (serviceSubscription.serviceInstances != null) {
+ for (ServiceInstance serviceInstance : serviceSubscription.serviceInstances.serviceInstance) {
+ ServiceInstanceSearchResult serviceInstanceSearchResult =
+ new ServiceInstanceSearchResult(serviceInstance.serviceInstanceId, subscriberId, serviceType, serviceInstance.serviceInstanceName,
+ subscriberName, serviceInstance.modelInvariantId, serviceInstance.modelVersionId, serviceSubscription.isPermitted);
+
+ if (instanceIdentifier == null) {
+ results.add(serviceInstanceSearchResult);
+ } else if (serviceInstanceMatchesIdentifier(instanceIdentifier, serviceInstance)) {
+ results.add(serviceInstanceSearchResult);
+ }
+ }
+ }
+
+ return results;
+ }
+
+ private boolean serviceInstanceMatchesIdentifier(String instanceIdentifier, ServiceInstance serviceInstance) {
+ return instanceIdentifier.equals(serviceInstance.serviceInstanceId) || instanceIdentifier.equals(serviceInstance.serviceInstanceName);
+ }
+
+ @Override
+ public Response getVersionByInvariantId(List<String> modelInvariantId) {
+ try {
+ return aaiClient.getVersionByInvariantId(modelInvariantId);
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+ return null;
+ }
+
+ @Override
+ public AaiResponse<Pnf> getSpecificPnf(String pnfId) {
+ return aaiClient.getSpecificPnf(pnfId);
+ }
+
+ @Override
+ public AaiResponse getPNFData(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion, String equipVendor, String equipModel) {
+ return aaiClient.getPNFData(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion, equipVendor, equipModel);
+ }
+
+
+
+ @Override
+ public AaiResponse getServices(RoleValidator roleValidator) {
+ AaiResponse<GetServicesAAIRespone> subscriberResponse = aaiClient.getServices();
+ if (subscriberResponse.getT() != null)
+ for (org.onap.vid.aai.model.AaiGetServicesRequestModel.Service service : subscriberResponse.getT().service) {
+ service.isPermitted = true;
+ }
+ return subscriberResponse;
+ }
+
+ @Override
+ public AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator) {
+ AaiResponse<GetTenantsResponse[]> aaiGetTenantsResponse = aaiClient.getTenants(globalCustomerId, serviceType);
+ GetTenantsResponse[] tenants = aaiGetTenantsResponse.getT();
+ if (tenants != null) {
+ for (int i = 0; i < tenants.length; i++) {
+ tenants[i].isPermitted = roleValidator.isTenantPermitted(globalCustomerId, serviceType, tenants[i].tenantName);
+ }
+ }
+ return aaiGetTenantsResponse;
+
+
+ }
+
+ @Override
+ public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
+ return aaiClient.getVNFData(globalSubscriberId, serviceType, serviceInstanceId);
+ }
+
+ @Override
+ public Response getVNFData(String globalSubscriberId, String serviceType) {
+ return aaiClient.getVNFData(globalSubscriberId, serviceType);
+ }
+
+ @Override
+ public AaiResponse getAaiZones() {
+ AaiResponse<AicZones> response = aaiClient.getAllAicZones();
+ return response;
+ }
+
+ @Override
+ public AaiResponse getAicZoneForPnf(String globalCustomerId, String serviceType, String serviceId) {
+ String aicZone = "";
+
+ AaiResponse<ServiceRelationships> serviceInstanceResp = aaiClient.getServiceInstance(globalCustomerId, serviceType, serviceId);
+ if (serviceInstanceResp.getT() != null) {
+ List<String> aicZoneList = getRelationshipDataByType(serviceInstanceResp.getT().getRelationshipList(), "zone", "zone.zone-id");
+ if (aicZoneList.size() > 0) {
+ aicZone = aicZoneList.get(0);
+ } else {
+ logger.warn("aic zone not found for service instance " + serviceId);
+ }
+ } else {
+ if (serviceInstanceResp.getErrorMessage() != null) {
+ logger.error("get service instance " + serviceId + " return error", serviceInstanceResp.getErrorMessage());
+ return new AaiResponse(aicZone , serviceInstanceResp.getErrorMessage() ,serviceInstanceResp.getHttpCode());
+ } else {
+ logger.warn("get service instance " + serviceId + " return empty body");
+ return new AaiResponse(aicZone , "get service instance " + serviceId + " return empty body" ,serviceInstanceResp.getHttpCode());
+ }
+ }
+
+ return new AaiResponse(aicZone , null ,HttpStatus.SC_OK);
+ }
+
+ @Override
+ public AaiResponse getNodeTemplateInstances(String globalCustomerId, String serviceType, String modelVersionId, String modelInvariantId, String cloudRegion) {
+ return aaiClient.getNodeTemplateInstances(globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegion);
+ }
+
+ @Override
+ public Collection<Service> getServicesByDistributionStatus() {
+ AaiResponse<GetServiceModelsByDistributionStatusResponse> serviceModelsByDistributionStatusResponse = aaiClient.getServiceModelsByDistributionStatus();
+ Collection<Service> services = new ArrayList<>();
+ if (serviceModelsByDistributionStatusResponse.getT() != null) {
+ List<Result> results = serviceModelsByDistributionStatusResponse.getT().getResults();
+ for (Result result : results) {
+ if(result.getModel() != null) {
+ List<Service> service = convertModelToService(result.getModel());
+ if (service != null) {
+ services.addAll(service);
+ }
+ }
+ }
+ }
+ return services;
+ }
+
+ @Override
+ public List<String> getServiceInstanceAssociatedPnfs(String globalCustomerId, String serviceType, String serviceInstanceId) {
+ List<String> pnfs = new ArrayList<>();
+
+ AaiResponse<ServiceRelationships> serviceInstanceResp = aaiClient.getServiceInstance(globalCustomerId, serviceType, serviceInstanceId);
+ if (serviceInstanceResp.getT() != null) {
+ List<String> logicalLinks = getRelationshipDataByType(serviceInstanceResp.getT().getRelationshipList(), "logical-link", "logical-link.link-name");
+ for (String logicalLink : logicalLinks) {
+ String link = "";
+ try {
+ link = URLEncoder.encode(logicalLink, "UTF-8");
+ AaiResponse<LogicalLinkResponse> logicalLinkResp = aaiClient.getLogicalLink(link);
+ if (logicalLinkResp.getT() != null) {
+ //lag-interface is the key for pnf - approved by Bracha
+ List<String> linkPnfs = getRelationshipDataByType(logicalLinkResp.getT().getRelationshipList(), "lag-interface", "pnf.pnf-name");
+ if (linkPnfs.size() > 0) {
+ pnfs.addAll(linkPnfs);
+ } else {
+ logger.warn("no pnf found for logical link " + logicalLink);
+ }
+ } else {
+ if (logicalLinkResp.getErrorMessage() != null) {
+ logger.error("get logical link " + logicalLink + " return error", logicalLinkResp.getErrorMessage());
+ } else {
+ logger.warn("get logical link " + logicalLink + " return empty body");
+ }
+ }
+ } catch (UnsupportedEncodingException e) {
+ logger.error("Failed to encode logical link: " + logicalLink, e.getMessage());
+ }
+ }
+ } else {
+ if (serviceInstanceResp.getErrorMessage() != null) {
+ logger.error("get service instance " + serviceInstanceId + " return error", serviceInstanceResp.getErrorMessage());
+ } else {
+ logger.warn("get service instance " + serviceInstanceId + " return empty body");
+ }
+ }
+
+ return pnfs.stream().distinct().collect(Collectors.toList());
+ }
+
+ private List<String> getRelationshipDataByType(RelationshipList relationshipList, String relationshipType, String relationshipDataKey) {
+ List<String> relationshipValues = new ArrayList<>();
+ for (Relationship relationship : relationshipList.getRelationship()) {
+ if (relationship.getRelatedTo().equals(relationshipType)) {
+ relationshipValues.addAll( relationship.getRelationDataList().stream()
+ .filter(rel -> rel.getRelationshipKey().equals(relationshipDataKey))
+ .map(RelationshipData::getRelationshipValue)
+ .collect(Collectors.toList())
+ );
+ }
+ }
+
+
+ return relationshipValues;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java
new file mode 100644
index 000000000..a140007b0
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterService.java
@@ -0,0 +1,18 @@
+package org.onap.vid.services;
+
+import java.io.IOException;
+
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.model.CategoryParameterOption;
+import org.onap.vid.model.CategoryParameter.Family;
+
+public interface CategoryParameterService {
+
+ CategoryParametersResponse getCategoryParameters(Family familyName) throws IOException;
+ AddCategoryOptionResponse createCategoryParameterOptions(String categoryName, AddCategoryOptionsRequest option) throws IOException;
+ AddCategoryOptionResponse updateCategoryParameterOption(String categoryName, CategoryParameterOptionRep option);
+ void deleteCategoryOption(String categoryName, CategoryParameterOption option) throws IOException;
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java
new file mode 100644
index 000000000..02d3521dc
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CategoryParameterServiceImpl.java
@@ -0,0 +1,144 @@
+package org.onap.vid.services;
+
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.onap.vid.category.AddCategoryOptionResponse;
+import org.onap.vid.category.CategoryParameterOptionRep;
+import org.onap.vid.model.CategoryParameter;
+import org.onap.vid.model.CategoryParameterOption;
+import org.onap.vid.category.AddCategoryOptionsRequest;
+import org.onap.vid.category.CategoryParametersResponse;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.onap.vid.model.CategoryParameter.Family;
+
+import javax.ws.rs.ForbiddenException;
+
+
+@Service
+public class CategoryParameterServiceImpl implements CategoryParameterService {
+
+ @Autowired
+ private DataAccessService dataAccessService;
+
+ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(CategoryParameterServiceImpl.class);
+
+ public static class UnfoundedCategoryException extends RuntimeException {
+
+ public UnfoundedCategoryException(String message) {
+ super(message);
+ }
+ }
+
+ public static class UnfoundedCategoryOptionException extends RuntimeException {
+
+ public UnfoundedCategoryOptionException(String message) {
+ super(message);
+ }
+ }
+
+ public static class AlreadyExistOptionNameException extends RuntimeException {
+
+ public AlreadyExistOptionNameException(String message) {
+ super(message);
+ }
+ }
+
+ @Override
+ public CategoryParametersResponse getCategoryParameters(Family familyName) throws IOException {
+ List<CategoryParameter> categoryParameters = dataAccessService.getList(CategoryParameter.class, String.format(" where family = '%s' ",familyName), null, null);
+ return convertToCategoryParametersResponse(categoryParameters);
+ }
+
+ private CategoryParametersResponse convertToCategoryParametersResponse(List<CategoryParameter> categoryParameters) {
+ Comparator<CategoryParameterOptionRep> comparator = Comparator.comparing(CategoryParameterOptionRep::getName, String.CASE_INSENSITIVE_ORDER);
+ Map<String, List<CategoryParameterOptionRep>> categoryParametersMap = categoryParameters.stream().collect(Collectors.toMap(
+ CategoryParameter::getName,
+ x -> x.getOptions().stream().map(opt -> new CategoryParameterOptionRep(opt.getAppId(), opt.getName())).sorted(comparator).collect(Collectors.toList())));
+ return new CategoryParametersResponse(categoryParametersMap);
+ }
+
+ @Override
+ public AddCategoryOptionResponse createCategoryParameterOptions(String categoryName, AddCategoryOptionsRequest optionsRequest) throws IOException, UnfoundedCategoryException {
+
+ AddCategoryOptionResponse response = new AddCategoryOptionResponse(new ArrayList<>());
+ CategoryParameter categoryParameter = getCategoryParameter(categoryName);
+ Set<String> categoryOptions = categoryParameter.getOptions().stream().map(CategoryParameterOption::getName).collect(Collectors.toSet());
+ for (String optionName : optionsRequest.options) {
+ if (categoryOptions.contains(optionName)) {
+ response.getErrors().add(String.format("Option %s already exist for category %s", optionName, categoryName));
+ continue;
+ }
+ String appId = categoryParameter.isIdSupported() ? UUID.randomUUID().toString() : optionName;
+ CategoryParameterOption categoryParameterOption = new CategoryParameterOption(appId, optionName, categoryParameter);
+ dataAccessService.saveDomainObject(categoryParameterOption, null);
+ }
+
+ return response;
+ }
+
+ private CategoryParameter getCategoryParameter( String categoryName) {
+ List<CategoryParameter> categoryParameters = dataAccessService.getList(CategoryParameter.class, String.format(" where name = '%s' ", categoryName), null, null);
+ if (categoryParameters.size() != 1) {
+ String msg = "There is no category parameter with name " + categoryName;
+ LOG.debug(msg);
+ throw new UnfoundedCategoryException(msg);
+ }
+
+
+ return categoryParameters.get(0);
+ }
+
+ @Override
+ public AddCategoryOptionResponse updateCategoryParameterOption(String categoryName, CategoryParameterOptionRep option) {
+ AddCategoryOptionResponse response = new AddCategoryOptionResponse(new ArrayList<>());
+ CategoryParameter categoryParameter = getCategoryParameter(categoryName);
+ if (!categoryParameter.isIdSupported()) {
+ String msg = "Updating option name for category: " + categoryName + ", is not allowed";
+ LOG.debug(msg);
+ throw new ForbiddenException(msg);
+ }
+ Optional<CategoryParameterOption> categoryParameterOptionOptional = categoryParameter.getOptions().stream().filter(x->x.getAppId().equals(option.getId())).findFirst();
+ if (!categoryParameterOptionOptional.isPresent()) {
+ String msg = "There is no option with id "+option.getId() + " for category " + categoryName;
+ LOG.debug(msg);
+ throw new UnfoundedCategoryOptionException(msg);
+ }
+ CategoryParameterOption categoryParameterOption = categoryParameterOptionOptional.get();
+ Optional<CategoryParameterOption> alreadyExistOptionWithName = categoryParameter.getOptions().stream().filter(x->x.getName().equals(option.getName())).findFirst();
+ if (alreadyExistOptionWithName.isPresent() && !alreadyExistOptionWithName.get().getAppId().equals(categoryParameterOption.getAppId())) {
+ String msg = "Option with name "+option.getName() + " already exist for category " + categoryName;
+ LOG.debug(msg);
+ throw new AlreadyExistOptionNameException(msg);
+ }
+
+ categoryParameterOption.setName(option.getName());
+ dataAccessService.saveDomainObject(categoryParameterOption, null);
+
+ return response;
+ }
+
+ @Override
+ public void deleteCategoryOption(String categoryName, CategoryParameterOption option) throws IOException {
+ List<CategoryParameter> categoryParameters = dataAccessService.getList(CategoryParameter.class, String.format(" where name = '%s'", categoryName), null, null);
+ if (categoryParameters.size() != 1) {
+ String msg = "There is no category parameter with name " + categoryName;
+ LOG.debug(msg);
+ throw new UnfoundedCategoryException(msg);
+ }
+ CategoryParameter categoryParameter = categoryParameters.get(0);
+ Set<CategoryParameterOption> categoryOptions = categoryParameter.getOptions();
+ for (CategoryParameterOption categoryOption: categoryOptions) {
+ if(categoryOption.getName().equals(option.getName()))
+ {
+ dataAccessService.deleteDomainObject(categoryOption, null);
+ }
+ }
+ }
+
+}
+
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java
new file mode 100644
index 000000000..bf0833182
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementService.java
@@ -0,0 +1,32 @@
+package org.onap.vid.services;
+
+import fj.data.Either;
+import org.apache.commons.lang3.tuple.Pair;
+import org.json.JSONObject;
+import org.onap.vid.changeManagement.*;
+import org.json.simple.JSONArray;
+import org.onap.vid.mso.rest.Request;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.util.Collection;
+import java.util.List;
+
+public interface ChangeManagementService {
+ Collection<Request> getMSOChangeManagements() throws Exception;
+ ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName) throws Exception;
+ JSONArray getSchedulerChangeManagements();
+
+ /**
+ * Deleting a scheduled flow.
+ * @param scheduleId - the ID of the schedule.
+ * @return - a pair, left - String representation of the response, right - response code.
+ */
+ Pair<String, Integer> deleteSchedule(String scheduleId);
+ VnfWorkflowRelationResponse addVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest);
+ List<String> getWorkflowsForVnf(GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest);
+ VnfWorkflowRelationResponse deleteVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest);
+ VnfWorkflowRelationAllResponse getAllVnfWorkflowRelations();
+ String uploadConfigUpdateFile(MultipartFile file) throws Exception;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java
new file mode 100644
index 000000000..078f44945
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/ChangeManagementServiceImpl.java
@@ -0,0 +1,303 @@
+package org.onap.vid.services;
+
+import org.apache.commons.lang3.tuple.ImmutablePair;
+import org.apache.commons.lang3.tuple.Pair;
+import org.hibernate.NonUniqueObjectException;
+import org.json.JSONObject;
+import org.json.simple.JSONArray;
+import org.json.simple.parser.JSONParser;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.service.DataAccessService;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.onap.vid.changeManagement.*;
+import org.onap.vid.exceptions.NotFoundException;
+import org.onap.vid.model.VNFDao;
+import org.onap.vid.model.VidWorkflow;
+import org.onap.vid.mso.MsoBusinessLogic;
+import org.onap.vid.mso.MsoResponseWrapperInterface;
+import org.onap.vid.mso.rest.Request;
+import org.onap.vid.scheduler.SchedulerProperties;
+import org.onap.vid.scheduler.SchedulerRestInterfaceFactory;
+import org.onap.vid.scheduler.SchedulerRestInterfaceIfc;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+import org.springframework.web.multipart.MultipartFile;
+
+import javax.ws.rs.BadRequestException;
+import java.util.*;
+import java.util.stream.Collectors;
+
+
+@Service
+public class ChangeManagementServiceImpl implements ChangeManagementService {
+
+ private final static String primaryKey = "payload";
+ private final static Set<String> requiredKeys = new HashSet<>(Arrays.asList("request-parameters", "configuration-parameters"));
+ private final DataAccessService dataAccessService;
+ private EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ChangeManagementServiceImpl.class);
+ private MsoBusinessLogic msoBusinessLogic;
+ @Autowired
+ private CsvService csvService;
+
+ @Autowired
+ public ChangeManagementServiceImpl(DataAccessService dataAccessService, MsoBusinessLogic msoBusinessLogic) {
+ this.dataAccessService = dataAccessService;
+ this.msoBusinessLogic = msoBusinessLogic;
+ }
+
+ @Override
+ public Collection<Request> getMSOChangeManagements() throws Exception {
+ Collection<Request> result = null;
+ return msoBusinessLogic.getOrchestrationRequestsForDashboard();
+ }
+
+ private RequestDetails findRequestByVnfName(List<RequestDetails> requests, String vnfName) {
+
+ if (requests == null)
+ return null;
+
+ for (RequestDetails requestDetails : requests) {
+ if (requestDetails.getVnfName().equals(vnfName)) {
+ return requestDetails;
+ }
+ }
+
+ return null;
+ }
+
+ @Override
+ public ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName) throws Exception {
+ if (request == null)
+ return null;
+ ResponseEntity<String> response;
+ RequestDetails currentRequestDetails = findRequestByVnfName(request.getRequestDetails(), vnfName);
+ MsoResponseWrapperInterface msoResponseWrapperObject = null;
+ if (currentRequestDetails != null) {
+
+ String serviceInstanceId = extractServiceInstanceId(currentRequestDetails, request.getRequestType());
+ String vnfInstanceId = extractVnfInstanceId(currentRequestDetails, request.getRequestType());
+ String requestType = request.getRequestType();
+ try {
+ switch (requestType.toLowerCase()) {
+ case ChangeManagementRequest.UPDATE: {
+ msoResponseWrapperObject = msoBusinessLogic.updateVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+ break;
+ }
+ case ChangeManagementRequest.REPLACE: {
+ msoResponseWrapperObject = msoBusinessLogic.replaceVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+ break;
+ }
+ case ChangeManagementRequest.VNF_IN_PLACE_SOFTWARE_UPDATE: {
+ msoResponseWrapperObject = msoBusinessLogic.updateVnfSoftware(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+ break;
+ }
+ case ChangeManagementRequest.CONFIG_UPDATE: {
+ msoResponseWrapperObject = msoBusinessLogic.updateVnfConfig(currentRequestDetails, serviceInstanceId, vnfInstanceId);
+ break;
+ }
+ }
+ response = new ResponseEntity<String>(msoResponseWrapperObject.getResponse(), HttpStatus.OK);
+ return response;
+ } catch (Exception e) {
+ logger.error("Failure during doChangeManagement with request " + request.toString(), e);
+ throw e;
+ }
+
+ }
+
+ // AH:TODO: return ChangeManagementResponse
+ return null;
+ }
+
+ private String extractVnfInstanceId(RequestDetails currentRequestDetails, String requestType) {
+ if (currentRequestDetails.getVnfInstanceId() == null) {
+ logger.error("Failed to extract vnfInstanceId");
+ throw new BadRequestException("No vnfInstanceId in request " + requestType);
+ }
+ return currentRequestDetails.getVnfInstanceId();
+ }
+
+ private String extractServiceInstanceId(RequestDetails currentRequestDetails, String requestType) {
+ try {
+ String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0).getRelatedInstance().getInstanceId();
+ serviceInstanceId.toString(); //throw exception in case that serviceInstanceId is null...
+ return serviceInstanceId;
+ } catch (Exception e) {
+ logger.error("Failed to extract serviceInstanceId");
+ throw new BadRequestException("No instanceId in request " + requestType);
+ }
+ }
+
+ @Override
+ public JSONArray getSchedulerChangeManagements() {
+ JSONArray result = null;
+ try {
+ String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_SCHEDULES);
+ org.onap.vid.scheduler.RestObject<String> restObject = new org.onap.vid.scheduler.RestObject<>();
+ SchedulerRestInterfaceIfc restClient = SchedulerRestInterfaceFactory.getInstance();
+
+ String str = new String();
+ restObject.set(str);
+ restClient.Get(str, "", path, restObject);
+ String restCallResult = restObject.get();
+ JSONParser parser = new JSONParser();
+ Object parserResult = parser.parse(restCallResult);
+ result = (JSONArray) parserResult;
+ } catch (Exception e) {
+ e.printStackTrace();
+ }
+
+ return result;
+ }
+
+ @Override
+ public Pair<String, Integer> deleteSchedule(String scheduleId) {
+ try {
+ String path = String.format(SystemProperties.getProperty(SchedulerProperties.SCHEDULER_DELETE_SCHEDULE), scheduleId);
+ org.onap.vid.scheduler.RestObject<String> restObject = new org.onap.vid.scheduler.RestObject<>();
+ SchedulerRestInterfaceIfc restClient = SchedulerRestInterfaceFactory.getInstance();
+ String str = new String();
+ restObject.set(str);
+ restClient.Delete(str, "", path, restObject);
+ String restCallResult = restObject.get();
+ return new ImmutablePair<>(restCallResult, restObject.getStatusCode());
+ } catch (Exception e) {
+ logger.error(e.getMessage(), e);
+ return new ImmutablePair<>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR.value());
+ }
+ }
+
+ @Override
+ public VnfWorkflowRelationResponse addVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest) {
+ VnfWorkflowRelationResponse vnfWorkflowRelationResponse = new VnfWorkflowRelationResponse();
+ for (WorkflowsDetail workflowsDetail : vnfWorkflowRelationRequest.getWorkflowsDetails()) {
+ if (StringUtils.isEmpty(workflowsDetail.getVnfDetails().getUUID()) ||
+ StringUtils.isEmpty(workflowsDetail.getVnfDetails().getInvariantUUID())) {
+ vnfWorkflowRelationResponse.getErrors().add("Using empty UUID or invariantUUID is not allowed. Relation details: " + workflowsDetail.toString());
+ continue;
+ }
+ @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, getVnfQueryString(workflowsDetail.getVnfDetails().getUUID(), workflowsDetail.getVnfDetails().getInvariantUUID()), null, null);
+ if (vnfList.size() == 0) {
+ vnfList.add(saveNewVnf(workflowsDetail));
+ }
+ @SuppressWarnings("unchecked") List<VidWorkflow> workflowList = dataAccessService.getList(VidWorkflow.class, String.format(" where wokflowName = '%s'", workflowsDetail.getWorkflowName()), null, null);
+ if (workflowList.size() == 0) {
+ vnfWorkflowRelationResponse.getErrors().add("Not Found instance of workflow " + workflowsDetail.getWorkflowName() + " for vnf with UUID " + workflowsDetail.getVnfDetails().getUUID() + " and with invariantUUID " + workflowsDetail.getVnfDetails().getInvariantUUID());
+ continue;
+ }
+ vnfList.get(0).getWorkflows().add(workflowList.get(0));
+ try {
+ dataAccessService.saveDomainObject(vnfList.get(0), null);
+ } catch (NonUniqueObjectException e) {
+ //In case the relation already exists, we continue running on the list
+ }
+ }
+ return vnfWorkflowRelationResponse;
+ }
+
+ @Override
+ public VnfWorkflowRelationResponse deleteVnfWorkflowRelation(VnfWorkflowRelationRequest vnfWorkflowRelationRequest) {
+ VnfWorkflowRelationResponse vnfWorkflowRelationResponse = new VnfWorkflowRelationResponse();
+ for (WorkflowsDetail workflowsDetail : vnfWorkflowRelationRequest.getWorkflowsDetails()) {
+ @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, getVnfQueryString(workflowsDetail.getVnfDetails().getUUID(), workflowsDetail.getVnfDetails().getInvariantUUID()), null, null);
+ if (vnfList.size() != 1) {
+ vnfWorkflowRelationResponse.getErrors().add("Found " + vnfList.size() + " instances of vnf with UUID " + workflowsDetail.getVnfDetails().getUUID() + " and vnfInvariantUUID " + workflowsDetail.getVnfDetails().getInvariantUUID());
+ continue;
+ }
+ VidWorkflow vidWorkflow = getWorkflowOfVnf(vnfList.get(0), workflowsDetail.getWorkflowName());
+ if (vidWorkflow == null) {
+ vnfWorkflowRelationResponse.getErrors().add("Not Found instance of workflow " + workflowsDetail.getWorkflowName() + " for vnf with UUID " + workflowsDetail.getVnfDetails().getUUID() + " and with invariantUUID " + workflowsDetail.getVnfDetails().getInvariantUUID());
+ continue;
+ }
+ vnfList.get(0).getWorkflows().remove(vidWorkflow);
+ dataAccessService.saveDomainObject(vnfList.get(0), null);
+ }
+ return vnfWorkflowRelationResponse;
+
+ }
+
+ @Override
+ public List<String> getWorkflowsForVnf(GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest) {
+ List<VNFDao> vnfDaoList = new ArrayList<>();
+ List<Set<String>> workflowsList = new ArrayList<>();
+ getVnfDaoList(vnfDaoList, getVnfWorkflowRelationRequest);
+ getWorkflowsList(workflowsList, vnfDaoList);
+ return intersectWorkflows(workflowsList);
+ }
+
+ private void getVnfDaoList(List<VNFDao> vnfDaoList, GetVnfWorkflowRelationRequest getVnfWorkflowRelationRequest) {
+ for (VnfDetails vnfDetails : getVnfWorkflowRelationRequest.getVnfDetails()) {
+ @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, getVnfQueryString(vnfDetails.getUUID(), vnfDetails.getInvariantUUID()), null, null);
+ if (vnfList.size() != 1) {
+ throw new NotFoundException("Found" + vnfList.size() + " instances of vnf with UUID" + vnfDetails.getUUID() + " and vnfInvariantUUID" + vnfDetails.getInvariantUUID());
+ }
+ vnfDaoList.add(vnfList.get(0));
+ }
+ }
+
+ private void getWorkflowsList(List<Set<String>> workflowsList, List<VNFDao> vnfDaoList) {
+ for (VNFDao vnfDao : vnfDaoList) {
+ Set<String> tempWorkflows = vnfDao.getWorkflows().stream().map(VidWorkflow::getWokflowName).collect(Collectors.toSet());
+ workflowsList.add(tempWorkflows);
+ }
+ }
+
+ private List<String> intersectWorkflows(List<Set<String>> workflowsList) {
+ Set<String> workflows = workflowsList.get(0);
+ for (Set<String> workflow : workflowsList) {
+ workflows.retainAll(workflow);
+ }
+ return new ArrayList<>(workflows);
+ }
+
+ private String getVnfQueryString(String UUID, String invariantUUID) {
+ return " where vnfInvariantUUID = '" + invariantUUID + "' and vnfUUID = '" + UUID + "'";
+ }
+
+ private VidWorkflow getWorkflowOfVnf(VNFDao vnfDao, String workflowName) {
+ VidWorkflow vidWorkflowRes = null;
+ for (VidWorkflow vidWorkflow : vnfDao.getWorkflows()) {
+ if (vidWorkflow.getWokflowName().equals(workflowName)) {
+ vidWorkflowRes = vidWorkflow;
+ }
+ }
+ return vidWorkflowRes;
+ }
+
+ private VNFDao saveNewVnf(WorkflowsDetail workflowsDetail) {
+ VNFDao vnfDao = new VNFDao();
+ vnfDao.setVnfUUID(workflowsDetail.getVnfDetails().getUUID());
+ vnfDao.setVnfInvariantUUID(workflowsDetail.getVnfDetails().getInvariantUUID());
+ dataAccessService.saveDomainObject(vnfDao, null);
+ return vnfDao;
+ }
+
+ @Override
+ public VnfWorkflowRelationAllResponse getAllVnfWorkflowRelations() {
+ @SuppressWarnings("unchecked") List<VNFDao> vnfList = dataAccessService.getList(VNFDao.class, null);
+ return new VnfWorkflowRelationAllResponse(
+ vnfList.stream()
+ .map(VnfDetailsWithWorkflows::new)
+ .collect(Collectors.toList()));
+ }
+
+ @Override
+ public String uploadConfigUpdateFile(MultipartFile file)
+ throws Exception {
+ JSONObject json = csvService.convertCsvToJson(csvService.readCsv(file));
+ if (!validateJsonOutput(json))
+ throw new BadRequestException("Invalid csv file");
+ json = json.getJSONObject(primaryKey);
+ json = new JSONObject().put(primaryKey, json.toString());
+ return json.toString();
+ }
+
+ private boolean validateJsonOutput(org.json.JSONObject json) {
+ if (!json.has(primaryKey) || !json.getJSONObject(primaryKey).keySet().containsAll(requiredKeys))
+ return false;
+ return true;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvService.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvService.java
new file mode 100644
index 000000000..248068fba
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvService.java
@@ -0,0 +1,15 @@
+package org.onap.vid.services;
+
+import org.json.JSONObject;
+import org.springframework.web.multipart.MultipartFile;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.List;
+
+public interface CsvService {
+ List<String[]> readCsv(String filePath) throws IOException;
+ JSONObject convertCsvToJson (List<String[]> myEntries) throws InstantiationException, IllegalAccessException;
+ List<String[]> readCsv(MultipartFile file) throws IOException;
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java
new file mode 100644
index 000000000..8152dae04
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/CsvServiceImpl.java
@@ -0,0 +1,250 @@
+//package org.onap.vid.services;
+//
+////import com.opencsv.CSVReader;
+//import org.json.JSONArray;
+//import org.json.JSONObject;
+//import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+//import org.springframework.stereotype.Service;
+//import org.springframework.web.multipart.MultipartFile;
+//
+//import javax.ws.rs.BadRequestException;
+//import java.io.FileNotFoundException;
+//import java.io.FileReader;
+//import java.io.IOException;
+//import java.io.InputStreamReader;
+//import java.util.ArrayList;
+//import java.util.Arrays;
+//import java.util.List;
+//
+//import static org.onap.vid.utils.Logging.getMethodName;
+//
+//@Service
+//public class CsvServiceImpl implements CsvService{
+//
+//
+// /** The logger. */
+// static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(CsvServiceImpl.class);
+//
+// private static final String arrayRegex = "\\[(.*?)\\]";
+//
+//
+// /**
+// * In UTF-8 the first line starts with "\uFEFF" so need to remove it
+// * @param line is first line contains BOM
+// * @return line after change
+// */
+// private String [] removeBOMFromCsv(String [] line){
+// if (line.length>0)
+// line[0] = line[0].replaceFirst("\uFEFF","").replaceFirst("","");
+// return line;
+// }
+//
+// /**
+// * read a csv file and puts its content in list of string arrays (without the empty lines)
+// * @param filePath - the path of file to read
+// * @return the content of file
+// * @throws IOException
+// */
+// /*@Override
+// public List<String[]> readCsv(String filePath) throws IOException {
+// CSVReader reader = new CSVReader(new FileReader(filePath));
+// return readCsv(reader);
+// }
+//
+// @Override
+// public List<String[]> readCsv(MultipartFile file) throws IOException {
+// CSVReader reader = new CSVReader(new InputStreamReader(file.getInputStream()));
+// return readCsv(reader);
+// }
+//
+// private List<String[]> addLineWithoutSpaces(List<String[]> myEntries, String [] line){
+// line = Arrays.stream(line).filter(x -> !"".equals(x)).toArray(String[]::new);
+// if(line.length > 0)
+// myEntries.add(line);
+// return myEntries;
+// }
+//
+//
+// private List<String[]> readCsv(CSVReader reader) throws IOException {
+// try {
+// List<String[]> myEntries = new ArrayList<>() ;
+// String [] line;
+// Boolean firstLine = true;
+// while ((line = reader.readNext())!= null) {
+// if (firstLine) {
+// line = removeBOMFromCsv(line);
+// firstLine = false;
+// }
+// myEntries = addLineWithoutSpaces(myEntries, line);
+// }
+// return myEntries;
+// }
+// catch (Exception e){
+// logger.error("error during reading CSV file. exception:" + e.getMessage());
+// throw e;
+// }
+//
+// }*/
+//
+// /**
+// * main function that call to the recursive function with initial parameters
+// * @param myEntries - the matrix with file content
+// * @return the json
+// * @throws IOException
+// * @throws InstantiationException
+// * @throws IllegalAccessException
+// */
+// @Override
+// public JSONObject convertCsvToJson (List<String[]> myEntries) throws InstantiationException, IllegalAccessException {
+// try {
+// return buildJSON(myEntries, 0, 0, myEntries.size(), JSONObject.class);
+// }
+// catch (Exception e){
+// logger.error("error during parsing CSV file. exception:" + e.getMessage());
+// throw e;
+// }
+//
+// }
+//
+// /**
+// * it goes over the matrix column while the values are the same and returns the index of changed value
+// * @param myEntries the matrix
+// * @param i row index refer to the whole matrix
+// * @param j column index
+// * @param numLines the length of the current inner matrix
+// * @param startLine row index of inner matrix
+// * @return the index of changed line
+// */
+// private int findIndexOfChangedLine(List<String[]> myEntries, final int i, final int j, final int numLines, final int startLine) {
+// int k;
+// for(k = 0; k + i - startLine < numLines && myEntries.get(i)[j].equals(myEntries.get(k + i)[j]) ; k++);
+// return k;
+// }
+//
+// /**
+// * check in array if its first element or if the key already exist in the previous item
+// * @param jsonArray - the array to search in
+// * @param key - the key to check
+// * @return if exists or first element return true, otherwise- false
+// */
+// private Boolean keyExistsOrFirstElement( JSONArray jsonArray,String key){
+// Boolean exists = false;
+// Boolean first = false;
+// JSONObject lastItem = lastItemInArray(jsonArray);
+// if (lastItem == null) {
+// first = true;
+// }
+// else {
+// if (lastItem.has(key)) {
+// exists = true;
+// }
+// }
+// return exists||first;
+// }
+//
+// /**
+// * return last json in json array
+// * @param jsonArray
+// * @return last item or null if the array is empty
+// */
+// private JSONObject lastItemInArray(JSONArray jsonArray){
+// JSONObject lastItem = null;
+// if(jsonArray.length()>0) {
+// lastItem = (JSONObject) jsonArray.get(jsonArray.length() - 1);
+// }
+// return lastItem;
+// }
+//
+// /**
+// * append current json to the main json
+// * @param json - the main json to append to it
+// * @param key - key to append
+// * @param values - value(s) to append
+// * @param <T> can be JSONObject or JSONArray
+// * @param <E> string or jsonObject or jsonArray
+// * @return json after put
+// * @throws IllegalAccessException
+// * @throws InstantiationException
+// */
+// private <T, E> T putJson(T json, String key, E values) throws IllegalAccessException, InstantiationException {
+// if (json instanceof JSONArray){
+// JSONArray currentJson= ((JSONArray)json);
+// if (values == null) //array of strings (for last item)
+// {
+// currentJson.put(key);
+// }
+// else {
+// if (keyExistsOrFirstElement(currentJson, key)) {
+// currentJson.put(new JSONObject().put(key, values));
+// } else {
+// JSONObject lastItem = lastItemInArray(currentJson);
+// lastItem.put(key, values);
+// }
+// }
+// }
+// if (json instanceof JSONObject){
+// if (values == null)
+// throw new BadRequestException("Invalid csv file");
+// ((JSONObject)json).put(key,values);
+// }
+// return json;
+// }
+//
+//
+// /**
+// * recursive function to build JSON. Each time it counts the same values in left and send the smaller matrix
+// * (until the changed value) to the next time.
+// *
+// * @param myEntries - the whole matrix
+// * @param i- row index of the whole matrix
+// * @param j - column index
+// * @param numLines - number of lines of inner matrix (num of same values in the left column)
+// * @param clazz JSONArray or JSONObject
+// * @param <T> JSONArray or JSONObject
+// * @return the json object
+// * @throws IllegalAccessException
+// * @throws InstantiationException
+// */
+// private <T> T buildJSON(List<String[]> myEntries, int i, final int j, final int numLines, Class<T> clazz) throws IllegalAccessException, InstantiationException {
+// logger.debug(EELFLoggerDelegate.debugLogger, "start {}({}, {}, {})", getMethodName(), i, j, numLines);
+// T json = clazz.newInstance();
+// int startLine = i;
+// while(i < numLines + startLine){
+// String[] currentRow = myEntries.get(i);
+// int length = currentRow.length;
+// int currentDuplicateRows = findIndexOfChangedLine(myEntries,i,j,numLines, startLine);
+// String key = currentRow[j];
+// if (j == length-1) {
+// json = putJson(json,currentRow[j],null);
+//
+// }
+// else
+// {
+// if (key.matches(arrayRegex)){
+// JSONArray arrayObjects = buildJSON(myEntries, i, j + 1, currentDuplicateRows, JSONArray.class);
+// json = putJson(json,key.replaceAll("\\[","").replaceAll("]",""),arrayObjects);
+// }
+// else {
+// if (j < length - 2) {
+// json = putJson(json, currentRow[j], buildJSON(myEntries, i, j + 1, currentDuplicateRows, JSONObject.class));
+// }
+// else
+// {
+// if (j == length - 2)//last object
+// {
+// if(currentDuplicateRows > 1) {
+// throw new BadRequestException("Invalid csv file");
+// }
+// json = putJson(json, currentRow[j], currentRow[j + 1]);
+// }
+// }
+// }
+// }
+// i += currentDuplicateRows;
+// }
+// logger.debug(EELFLoggerDelegate.debugLogger, "end {} json = {}", getMethodName(), json);
+// return json;
+// }
+//
+//}
+//
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java
new file mode 100644
index 000000000..ea2cea57b
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/RoleGenaratorServiceImpl.java
@@ -0,0 +1,164 @@
+package org.onap.vid.services;
+
+import jline.internal.Log;
+import org.junit.Test;
+import org.onap.vid.aai.*;
+import org.onap.vid.model.ModelConstants;
+import org.onap.vid.model.Subscriber;
+import org.onap.vid.model.SubscriberList;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.HashMap;
+
+@Service
+public class RoleGenaratorServiceImpl implements RoleGeneratorService {
+
+ @Autowired
+ AaiClientInterface client;
+
+ public static final String dbName = "vid_portal";
+ public static final String tblName = "fn_role";
+ public static final String tempDelimiter ="***";
+ public static final String oldDelimiter = "_";
+
+ @Override
+ public String generateRoleScript(Boolean firstRun) {
+ String query = "USE " + dbName + ";\r\n" +
+ "SET SQL_SAFE_UPDATES = 0;\r\n";
+ try {
+ AaiResponse<SubscriberList> subscribers = client.getAllSubscribers();
+ if (firstRun) {
+ query += replaceRolesToTempDelimiter("subscriber",buildSubscribersValuesForMappingsTable(subscribers.getT()));
+ }
+ query += addAvailableRolesCombination(firstRun, subscribers);
+
+ }
+ catch (Exception e) {
+ Log.error("There was an error in updating roles "+e.getMessage());
+ }
+ return query;
+ }
+
+ private String addAvailableRolesCombination(Boolean firstRun, AaiResponse<SubscriberList> subscribers) {
+ String query, availableRoles="";
+ HashMap<String,String> servicesNames = new HashMap<String,String>();
+ for (Subscriber subscriber: subscribers.getT().customer) {
+ AaiResponse<Services> subscriberResponse = client.getSubscriberData(subscriber.globalCustomerId);
+ for(ServiceSubscription service: subscriberResponse.getT().serviceSubscriptions.serviceSubscription) {
+ servicesNames.put(service.serviceType,"");
+ String roleName = "'" + subscriber.subscriberName + ModelConstants.ROLE_DELIMITER + service.serviceType + "'";
+ availableRoles += "("+roleName+"),";
+
+
+ }
+ }
+ availableRoles = availableRoles.substring(0,availableRoles.length()-1);
+ query = createTemporaryTableAvailableRoles(availableRoles);
+ if (firstRun){
+ query += replaceRolesToTempDelimiter("service",buildServicesValuesForMappingsTable(servicesNames));
+ query += replaceToNewDelimiter();
+ query += deleteWrongRecords();
+
+ }
+ query += insertAvailableRolesToFnRole();
+ query += dropTemporaryTable("available_roles");
+ return query;
+ }
+
+ private String buildSubscribersValuesForMappingsTable(SubscriberList subscribers){
+ String query="";
+ for (Subscriber subscriber : subscribers.customer) {
+ String subscriberName = subscriber.subscriberName.contains(oldDelimiter) ? subscriber.subscriberName.replace(oldDelimiter, tempDelimiter) : subscriber.subscriberName;
+ query = query + "('" + subscriber.globalCustomerId + "','" + subscriberName + "') ,";
+ }
+ if(query.length() > 0)
+ query = query.substring(0, query.length()-1) + ";\r\n";
+ return query;
+ }
+
+ private String buildServicesValuesForMappingsTable(HashMap<String,String> servicesNames){
+ final String[] query = {""};
+ servicesNames.forEach((k,v)->{
+ if (k.contains(oldDelimiter)) {
+ query[0] += "('" + k + "' ,'" + k.replace(oldDelimiter, tempDelimiter) +"'),";
+ }
+ });
+ if(query[0].length() > 0)
+ query[0] = query[0].substring(0, query[0].length()-1) + ";\r\n";
+ return query[0];
+ }
+
+ private String replaceRolesToTempDelimiter(String entityName, String valuesForMappingsTable ) {
+
+ AaiResponse<Services> services = client.getServices();
+ String query = "";
+ if (valuesForMappingsTable.length() > 0) {
+ query = "CREATE TEMPORARY TABLE IF NOT EXISTS " + entityName + "Mappings(mapKey VARCHAR(255),mapValue VARCHAR(255));\r\n" +
+ "INSERT INTO " + entityName + "Mappings VALUES ";
+ query += valuesForMappingsTable;
+ query += "UPDATE " + tblName + "\r\n" +
+ "INNER JOIN " + entityName + "Mappings ON role_name LIKE concat('%',mapKey, '%')\r\n" +
+ "SET ROLE_NAME = REPLACE(ROLE_NAME, mapKey, mapValue) ; \r\n" +
+ dropTemporaryTable(entityName + "Mappings");
+ }
+ return query;
+ }
+
+ private String replaceToNewDelimiter(){
+ String query = "UPDATE " + tblName + "\r\n" +
+ "SET ROLE_NAME = REPLACE(ROLE_NAME, '" + oldDelimiter + "', '" + ModelConstants.ROLE_DELIMITER + "');\r\n" ;
+ query += "UPDATE fn_role\r\n" +
+ "SET ROLE_NAME = REPLACE(ROLE_NAME, '" + tempDelimiter + "', '" + oldDelimiter + "');\r\n" ;
+ return query;
+ }
+
+ private String insertAvailableRolesToFnRole(){
+ String query="INSERT INTO fn_role (ROLE_NAME, ACTIVE_YN, PRIORITY)\r\n" +
+ "SELECT RNAME, 'Y', 5\r\n" +
+ "FROM available_roles\r\n" +
+ "WHERE NOT EXISTS (SELECT ROLE_NAME\r\n" +
+ "FROM fn_role \r\n" +
+ "where RNAME = ROLE_NAME);\r\n";
+ return query;
+ }
+
+
+
+ private String createTemporaryTableAvailableRoles(String availableRoles) {
+ String query = "CREATE TEMPORARY TABLE IF NOT EXISTS available_roles(rname VARCHAR(255));\r\n";
+ query += "INSERT INTO available_roles VALUES "+availableRoles+";\r\n";
+ return query;
+ }
+
+ private String deleteWrongRecords(){
+ String query ="CREATE TEMPORARY TABLE IF NOT EXISTS wrong_roles(roleID INT);\r\n" +
+ "INSERT INTO wrong_roles (roleID)\r\n" +
+ "SELECT ROLE_ID FROM fn_role LEFT JOIN available_roles ON role_name LIKE concat(rname, '%')\r\n" +
+ "WHERE available_roles.rname IS NULL AND ROLE_ID NOT IN (1,16);\r\n";
+ query += deleteCascade();
+ query += dropTemporaryTable("wrong_roles");
+ return query;
+ }
+
+ private String deleteCascade() {
+ String query = deleteFromTableByRoles("fn_role_composite", "PARENT_ROLE_ID");
+ query = query.substring(0, query.length()-1);
+ query += " OR wrong_roles.ROLEID = fn_role_composite.CHILD_ROLE_ID;\r\n";
+ query += deleteFromTableByRoles("fn_role_function", "ROLE_ID")+ "\r\n";
+ query += deleteFromTableByRoles("fn_user_role", "ROLE_ID")+ "\r\n";
+ query += deleteFromTableByRoles("fn_role", "ROLE_ID")+ "\r\n";
+ return query;
+ }
+
+ private String deleteFromTableByRoles(String table, String column) {
+ String query = "DELETE FROM " + table + "\r\n";
+ query += "using " + table + " inner join wrong_roles\r\n" +
+ "where wrong_roles.ROLEID = " + table + "." + column + ";";
+ return query;
+ }
+
+ private String dropTemporaryTable(String table) {
+ return "DROP TEMPORARY TABLE IF EXISTS " + table + ";\r\n";
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java b/vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java
new file mode 100644
index 000000000..2bc96a5b2
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/services/RoleGeneratorService.java
@@ -0,0 +1,5 @@
+package org.onap.vid.services;
+
+public interface RoleGeneratorService {
+ String generateRoleScript(Boolean firstRun);
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/VidService.java b/vid-app-common/src/main/java/org/onap/vid/services/VidService.java
index 4fb0ff160..328fad019 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/VidService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/VidService.java
@@ -1,8 +1,8 @@
-package org.openecomp.vid.services;
+package org.onap.vid.services;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.model.ServiceModel;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.model.ServiceModel;
import java.util.Collection;
import java.util.Map;
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
index f647af456..81966439e 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/VidServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/VidServiceImpl.java
@@ -1,20 +1,20 @@
-package org.openecomp.vid.services;
+package org.onap.vid.services;
import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException;
-import org.openecomp.vid.asdc.AsdcCatalogException;
-import org.openecomp.vid.asdc.AsdcClient;
-import org.openecomp.vid.asdc.beans.Service;
-import org.openecomp.vid.asdc.parser.ToscaParser;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl;
-import org.openecomp.vid.asdc.parser.ToscaParserImpl2;
-import org.openecomp.vid.model.ServiceModel;
+import org.onap.vid.asdc.AsdcCatalogException;
+import org.onap.vid.asdc.AsdcClient;
+import org.onap.vid.asdc.beans.Service;
+import org.onap.vid.asdc.parser.ToscaParser;
+import org.onap.vid.asdc.parser.ToscaParserImpl;
+import org.onap.vid.asdc.parser.ToscaParserImpl2;
+import org.onap.vid.model.ServiceModel;
import org.springframework.beans.factory.annotation.Autowired;
import java.nio.file.Path;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.*;
+import java.util.Collection;
+import java.util.Map;
+import java.util.UUID;
/**
* The Class VidController.
@@ -28,7 +28,6 @@ public class VidServiceImpl implements VidService {
/**
* The Constant dateFormat.
*/
- private final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
protected final AsdcClient asdcClient;
@Autowired
private ToscaParserImpl2 toscaParser;
@@ -61,17 +60,20 @@ public class VidServiceImpl implements VidService {
ServiceModel serviceModel = null;
try {
final Service asdcServiceMetadata = asdcClient.getService(UUID.fromString(uuid));
- try {
- serviceModel = toscaParser.makeServiceModel(serviceCsar, asdcServiceMetadata);
- }
- catch (SdcToscaParserException e){
- serviceModel = tosca.makeServiceModel(uuid, serviceCsar, asdcServiceMetadata);
- }
+ return getServiceModel(uuid, serviceCsar, tosca, asdcServiceMetadata);
} catch (Exception e) {
- e.printStackTrace();
+ LOG.error("Failed to download and proccess service from ASDC", e);
}
return serviceModel;
}
+ private ServiceModel getServiceModel(String uuid, Path serviceCsar, ToscaParser tosca, Service asdcServiceMetadata) throws Exception {
+ try {
+ return toscaParser.makeServiceModel(serviceCsar, asdcServiceMetadata);
+ } catch (SdcToscaParserException e) {
+ return tosca.makeServiceModel(uuid, serviceCsar, asdcServiceMetadata);
+ }
+ }
+
} \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
index 7f43433de..ea139080f 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowService.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowService.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.services;
+package org.onap.vid.services;
-import org.openecomp.vid.model.Workflow;
+import org.onap.vid.model.Workflow;
import java.util.Collection;
public interface WorkflowService {
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
index deb506069..037c49c17 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/WorkflowServiceImpl.java
+++ b/vid-app-common/src/main/java/org/onap/vid/services/WorkflowServiceImpl.java
@@ -1,6 +1,6 @@
-package org.openecomp.vid.services;
+package org.onap.vid.services;
-import org.openecomp.vid.model.Workflow;
+import org.onap.vid.model.Workflow;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java b/vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java
new file mode 100644
index 000000000..6e0d1fc25
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/Intersection.java
@@ -0,0 +1,31 @@
+package org.onap.vid.utils;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * Created by moriya1 on 10/10/2017.
+ */
+public class Intersection<T> {
+ public List<T> intersectMultipileArray(List<List<T>> lists) {
+ if (lists.size() == 1) {
+ return lists.get(0);
+ } else {
+ List<T> intersectResult = intersectTwoArrays(lists.get(0),lists.get(1));
+
+ lists.remove(0);
+ lists.remove(0);
+ lists.add(0,intersectResult);
+ return intersectMultipileArray(lists);
+ }
+
+ }
+
+ public List<T> intersectTwoArrays(List<T> list1, List<T> list2) {
+
+ List<T> intersect = list1.stream()
+ .filter(list2::contains)
+ .collect(Collectors.toList());
+ return intersect;
+ }
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java b/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java
new file mode 100644
index 000000000..16dde5682
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/Logging.java
@@ -0,0 +1,105 @@
+package org.onap.vid.utils;
+
+import com.att.eelf.configuration.EELFLogger;
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
+import org.openecomp.portalsdk.core.util.SystemProperties;
+import org.springframework.http.HttpMethod;
+import org.springframework.web.context.request.RequestContextHolder;
+import org.springframework.web.context.request.ServletRequestAttributes;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.ws.rs.ProcessingException;
+import javax.ws.rs.core.Response;
+import java.util.Arrays;
+import java.util.Optional;
+
+import static org.onap.vid.utils.Streams.not;
+
+public class Logging {
+
+ private Logging() {
+ }
+
+ public static final String HTTP_REQUESTS_OUTGOING = "http.requests.outgoing.";
+
+ public static final String requestIdHeaderKey = SystemProperties.ECOMP_REQUEST_ID;
+
+ private static ObjectMapper objectMapper = new ObjectMapper();
+
+ public static String getMethodName() {
+ return getMethodName(0);
+ }
+
+ public static String getMethodCallerName() {
+ return getMethodName(1);
+ }
+
+ private static String getMethodName(int depth) {
+ final StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
+ String thisClassName = stackTrace[1].getClassName();
+ final Optional<String> caller =
+ Arrays.stream(stackTrace)
+ .skip(1)
+ .filter(not(frame -> frame.getClassName().equals(thisClassName)))
+ .skip(depth)
+ .map(StackTraceElement::getMethodName)
+ .findFirst();
+ return caller.orElse("<unknonwn method name>");
+ }
+
+ public static EELFLogger getRequestsLogger(String serverName) {
+ return EELFLoggerDelegate.getLogger(HTTP_REQUESTS_OUTGOING +serverName);
+ }
+
+ public static void logRequest(final EELFLogger logger, final HttpMethod method, final String url, final Object body) {
+ if (!logger.isDebugEnabled()) {
+ return;
+ }
+
+ if (body == null) {
+ logRequest(logger, method, url);
+ return;
+ }
+
+ try {
+ String bodyAsJson = objectMapper.writeValueAsString(body);
+ logger.debug("Sending {} {} Body: {}", method.name(), url, bodyAsJson);
+ } catch (JsonProcessingException e) {
+ logRequest(logger, method, url);
+ logger.debug("Failed to parse object in logRequest. {}", body);
+ }
+ }
+
+ public static void logRequest(final EELFLogger logger, final HttpMethod method, final String url) {
+ logger.debug("Sending {} {}", method.name(), url);
+ }
+
+ public static <T> void logResponse(final EELFLogger logger, final HttpMethod method, final String url, final Response response, final Class<T> entityClass) {
+ if (!logger.isDebugEnabled()) {
+ return;
+ }
+ if (response == null) {
+ logger.debug("Received {} {} response: null", method.name(), url);
+ return;
+ }
+ try {
+ response.bufferEntity();
+ logger.debug("Received {} {} Status: {} . Body: {}", method.name(), url, response.getStatus(), response.readEntity(entityClass));
+ }
+ catch (ProcessingException | IllegalStateException e) {
+ logger.debug("Received {} {} Status: {} . Failed to read response as {}", method.name(), url, response.getStatus(), entityClass.getName());
+ }
+ }
+
+ public static void logResponse(final EELFLogger logger, final HttpMethod method, final String url, final Response response) {
+ logResponse(logger, method, url, response, String.class);
+ }
+
+ public static HttpServletRequest getHttpServletRequest(){
+ return ((ServletRequestAttributes) RequestContextHolder.currentRequestAttributes()).getRequest();
+ }
+
+
+}
diff --git a/vid-app-common/src/main/java/org/onap/vid/utils/Streams.java b/vid-app-common/src/main/java/org/onap/vid/utils/Streams.java
new file mode 100644
index 000000000..7f81b225a
--- /dev/null
+++ b/vid-app-common/src/main/java/org/onap/vid/utils/Streams.java
@@ -0,0 +1,47 @@
+package org.onap.vid.utils;
+
+import java.util.Iterator;
+import java.util.Spliterator;
+import java.util.Spliterators;
+import java.util.function.Consumer;
+import java.util.function.Predicate;
+import java.util.stream.Stream;
+import java.util.stream.StreamSupport;
+
+public class Streams {
+ public static <R> Predicate<R> not(Predicate<R> predicate) {
+ return predicate.negate();
+ }
+
+ public static <T> Stream<T> fromIterator(final Iterator<T> iterator) {
+ Iterable<T> iterable = () -> iterator;
+ return StreamSupport.<T>stream(iterable.spliterator(), false);
+ }
+
+
+ // https://stackoverflow.com/questions/20746429/limit-a-stream-by-a-predicate
+ private static <T> Spliterator<T> takeWhile(
+ Spliterator<T> splitr, Predicate<? super T> predicate) {
+ return new Spliterators.AbstractSpliterator<T>(splitr.estimateSize(), 0) {
+ boolean stillGoing = true;
+ @Override public boolean tryAdvance(Consumer<? super T> consumer) {
+ if (stillGoing) {
+ boolean hadNext = splitr.tryAdvance(elem -> {
+ if (predicate.test(elem)) {
+ consumer.accept(elem);
+ } else {
+ stillGoing = false;
+ }
+ });
+ return hadNext && stillGoing;
+ }
+ return false;
+ }
+ };
+ }
+
+ public static <T> Stream<T> takeWhile(Stream<T> stream, Predicate<? super T> predicate) {
+ return StreamSupport.stream(takeWhile(stream.spliterator(), predicate), false);
+ }
+
+}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java
deleted file mode 100644
index f1b1ba2df..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiClientInterface.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.SubscriberList;
-
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public interface AaiClientInterface {
-
- AaiResponse<SubscriberList> getAllSubscribers();
-
- AaiResponse getSubscriberData(String subscriberId);
-
- AaiResponse getServices();
-
- AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType);
-
- AaiResponse getAllAicZones();
-
- AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
-
- AaiResponse getVNFData();
-
- Response getVNFData(String globalSubscriberId, String serviceType);
-
- AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
-
- Response getVersionByInvariantId(List<String> modelInvariantId);
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java
deleted file mode 100644
index 337d1371d..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/aai/AaiResponse.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.aai;
-
-import org.openecomp.vid.model.ProxyResponse;
-
-/**
- * Created by Oren on 7/10/17.
- */
-public class AaiResponse<T> extends ProxyResponse{
-
- T t;
-
- public AaiResponse(T t, String errorMessage, int aaiHttpCode) {
- this.t = t;
- this.errorMessage = errorMessage;
- this.httpCode = aaiHttpCode;
- }
-
- public T getT() {
- return t;
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java
deleted file mode 100644
index 2f49aff0a..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestDetailsWrapper.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-/**
- * Created by Oren on 9/5/17.
- */
-public class RequestDetailsWrapper {
-
- public MsoRequestDetails requestDetails;
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java b/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java
deleted file mode 100644
index 37cad4735..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/changeManagement/RequestParameters.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.openecomp.vid.changeManagement;
-
-import java.util.HashMap;
-import java.util.Map;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
-"usePreload"
-})
-
-public class RequestParameters {
-
-
- @JsonProperty("usePreload")
- private Boolean usePreload;
- @JsonIgnore
- private Map<String, Object> additionalProperties = new HashMap<String, Object>();
-
- @JsonProperty("usePreload")
- public Boolean getUsePreload() {
- return usePreload;
- }
-
- @JsonProperty("usePreload")
- public void setUsePreload(Boolean usePreload) {
- this.usePreload = usePreload;
- }
-
- @JsonAnyGetter
- public Map<String, Object> getAdditionalProperties() {
- return this.additionalProperties;
- }
-
- @JsonAnySetter
- public void setAdditionalProperty(String name, Object value) {
- this.additionalProperties.put(name, value);
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java
deleted file mode 100755
index 0698cfd9c..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/BrowseServiceTypesController.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-
-/**
- * The Class BrowseServiceTypesController.
- */
-@RestController
-public class BrowseServiceTypesController extends RestrictedBaseController{
-
- /** The view name. */
- String viewName;
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(BrowseServiceTypesController.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The servlet context. */
- private @Autowired ServletContext servletContext;
-
- /**
- * Welcome.
- *
- * @param request the request
- * @return the model and view
- */
- @RequestMapping(value = {"/browseservicetypes" }, method = RequestMethod.GET)
- public ModelAndView welcome(HttpServletRequest request) {
-
- return new ModelAndView(getViewName());
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
- */
- public String getViewName() {
- return viewName;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
- */
- public void setViewName(String viewName) {
- this.viewName = viewName;
- }
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java
deleted file mode 100644
index 1af715464..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ChangeManagementController.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openecomp.vid.controller;
-
-import org.json.simple.JSONArray;
-import org.openecomp.portalsdk.core.controller.UnRestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.services.ChangeManagementService;
-import org.openecomp.vid.services.WorkflowService;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RequestParam;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.mso.rest.Request;
-
-import java.io.IOException;
-import java.util.Collection;
-
-import javax.servlet.http.HttpServletRequest;
-
-/**
- * Controller to handle ChangeManagement feature requests.
- */
-@RestController
-@RequestMapping("change-management")
-public class ChangeManagementController extends UnRestrictedBaseController {
- private EELFLoggerDelegate logger;
- private String fromAppId;
- private final WorkflowService workflowService;
- private final ChangeManagementService changeManagementService;
-
- @Autowired
- public ChangeManagementController(WorkflowService workflowService, ChangeManagementService changeManagementService) {
- this.logger = EELFLoggerDelegate.getLogger(ChangeManagementController.class);
- this.fromAppId = "VidChangeManagementController";
- this.workflowService = workflowService;
- this.changeManagementService = changeManagementService;
- }
-
- @RequestMapping(value = {"/workflow"}, method = RequestMethod.GET)
- public ResponseEntity<Collection<String>> getWorkflow(@RequestParam("vnfs") Collection<String> vnfs) throws IOException, InterruptedException {
- Collection<String> result = this.workflowService.getWorkflowsForVNFs(vnfs);
- return new ResponseEntity<>(result, HttpStatus.OK);
- }
-
- @RequestMapping(value = {"/mso"}, method = RequestMethod.GET)
- public ResponseEntity<Collection<Request>> getMSOChangeManagements() throws IOException, InterruptedException {
- Collection<Request> result = this.changeManagementService.getMSOChangeManagements();
- return new ResponseEntity<>(result, HttpStatus.OK);
- }
-
- @RequestMapping(value = "/workflow/{vnfName}", method = RequestMethod.POST)
- public ResponseEntity<String> changeManagement(@PathVariable("vnfName") String vnfName,
- HttpServletRequest request,
- @RequestBody ChangeManagementRequest changeManagmentRequest)
- throws Exception {
- return this.changeManagementService.doChangeManagement(changeManagmentRequest, vnfName);
- }
-
-
- @RequestMapping(value = {"/scheduler"}, method = RequestMethod.GET)
- public ResponseEntity<JSONArray> getSchedulerChangeManagements() throws IOException, InterruptedException {
- JSONArray result = this.changeManagementService.getSchedulerChangeManagements();
- return new ResponseEntity<>(result, HttpStatus.OK);
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java
deleted file mode 100644
index 0fd2079e9..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/SchedulerController.java
+++ /dev/null
@@ -1,244 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.UUID;
-
-import javax.servlet.http.HttpServletRequest;
-
-import org.json.simple.JSONObject;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestBody;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.scheduler.RestObjects.GetTimeSlotsRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostCreateNewVnfRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostSubmitVnfChangeRestObject;
-import org.openecomp.vid.scheduler.SchedulerProperties;
-import org.openecomp.vid.scheduler.SchedulerRestInterface;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.GetTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostCreateNewVnfWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerUtil;
-
-/**
- * Controller to handle Scheduler requests.
- */
-
-@RestController
-public class SchedulerController extends RestrictedBaseController {
-
- static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerController.class);
-
- /** The request date format. */
- public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-
- @Autowired
- private SchedulerRestInterface restController;
-
- /*
- *
- * GET SCHEDULER CONTROLLERS
- *
- */
-
- @RequestMapping(value = "/get_time_slots/{scheduler_request}", method = RequestMethod.GET)
- public ResponseEntity<String> getTimeSlots(HttpServletRequest request, @PathVariable("scheduler_request") String scheduler_request) throws Exception {
-
- Date startingTime = new Date();
- String startTimeRequest = requestDateFormat.format(startingTime);
-
- System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- System.out.println(startTimeRequest + " | Controller Scheduler GET : /get_time_slots/{scheduler_request} \n");
- System.out.println("Original Request : \n " + scheduler_request + '\n');
-
- String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_TIME_SLOTS) + scheduler_request;
-
- GetTimeSlotsWrapper schedulerResWrapper = getTimeSlots(scheduler_request, path, scheduler_request);
-
- Date endTime = new Date();
- String endTimeRequest = requestDateFormat.format(endTime);
- System.out.println(endTimeRequest + " | Controller Scheduler - GET\n");
-
- return (new ResponseEntity<String>(schedulerResWrapper.getResponse(), HttpStatus.OK));
-
- }
-
- protected GetTimeSlotsWrapper getTimeSlots(String request, String path, String uuid) throws Exception {
-
- try {
- //STARTING REST API CALL AS AN FACTORY INSTACE
- System.out.println("<== Get Time Slots Request START \n");
-
- GetTimeSlotsRestObject<String> restObjStr = new GetTimeSlotsRestObject<String>();
- String str = new String();
-
- restObjStr.set(str);
-
- restController.<String>Get(str, uuid, path, restObjStr);
- GetTimeSlotsWrapper schedulerRespWrapper = SchedulerUtil.getTimeSlotsWrapResponse(restObjStr);
-
- System.out.println("<== Get Time Slots Request END : Response = " + schedulerRespWrapper.getResponse() + '\n');
-
- return schedulerRespWrapper;
-
- } catch (Exception e) {
- System.out.println("<== Get Time Slots Request ERROR : " + e.toString() + '\n');
- throw e;
- }
- }
-
- /*
- *
- * POST SCHEDULER CONTROLLERS
- *
- */
-
- @SuppressWarnings("unchecked")
- @RequestMapping(value = "/post_create_new_vnf_change", method = RequestMethod.POST)
- public ResponseEntity<String> postCreateNewVNFChange(HttpServletRequest request, @RequestBody JSONObject scheduler_request) throws Exception {
-
- Date startingTime = new Date();
- String startTimeRequest = requestDateFormat.format(startingTime);
-
- System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- System.out.println(startTimeRequest + " | Controller Scheduler POST : post_create_new_vnf_change \n");
-
- //Generating uuid
- String uuid = UUID.randomUUID().toString();
-
- scheduler_request.put("scheduleId", uuid);
- System.out.println("<== UUID : " + uuid + '\n');
-
- //adding uuid to the request payload
- scheduler_request.put("scheduleId", uuid);
-
- System.out.println("<== UUID : " + uuid + '\n');
- System.out.println("Original Request : \n " + scheduler_request.toString() + '\n');
-
- String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_CREATE_NEW_VNF_CHANGE_INSTANCE_VAL) + uuid;
-
- PostCreateNewVnfWrapper responseWrapper = postSchedulingRequest(scheduler_request, path, uuid);
-
- Date endTime = new Date();
- String endTimeRequest = requestDateFormat.format(endTime);
- System.out.println(endTimeRequest + " | Controller Scheduler - POST\n");
-
- return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.OK));
- }
-
- protected PostCreateNewVnfWrapper postSchedulingRequest(JSONObject request, String path, String uuid) throws Exception {
-
- try {
- //STARTING REST API CALL AS AN FACTORY INSTACE
- System.out.println("<== Post Create New Vnf Scheduling Request START \n");
-
- PostCreateNewVnfRestObject<String> restObjStr = new PostCreateNewVnfRestObject<String>();
- String str = new String();
-
- restObjStr.set(str);
- restController.<String>Post(str, request, path, restObjStr);
-
- int status = restObjStr.getStatusCode();
- if (status >= 200 && status <= 299) {
- restObjStr.setUUID(uuid);
- }
-
- PostCreateNewVnfWrapper responseWrapper = SchedulerUtil.postCreateNewVnfWrapResponse(restObjStr);
-
- System.out.println("<== Post Create New Vnf Scheduling Request END : Response = " + responseWrapper.getResponse() + '\n');
-
- return responseWrapper;
-
- } catch (Exception e) {
- System.out.println("<== Post Create New Vnf Scheduling Request ERROR : " + e.toString() + '\n');
- throw e;
- }
- }
-
- @RequestMapping(value = "/submit_vnf_change_timeslots", method = RequestMethod.POST)
- public ResponseEntity<String> postSubmitVnfChangeTimeslots(HttpServletRequest request, @RequestBody JSONObject scheduler_request) throws Exception {
-
- Date startingTime = new Date();
- String startTimeRequest = requestDateFormat.format(startingTime);
-
- System.out.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
- System.out.println(startTimeRequest + " | Controller Scheduler POST : submit_vnf_change_timeslots \n");
-
- //Generating uuid
- String uuid = (String) scheduler_request.get("scheduleId");
- scheduler_request.remove("scheduleId");
-
- System.out.println("<== UUID : " + uuid + '\n');
- System.out.println("Original Request : \n " + scheduler_request.toString() + '\n');
-
- String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_SUBMIT_NEW_VNF_CHANGE).replace("{scheduleId}", uuid);
-
- PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = postSubmitSchedulingRequest(scheduler_request, path, uuid);
-
- Date endTime = new Date();
- String endTimeRequest = requestDateFormat.format(endTime);
- System.out.println(endTimeRequest + " | Controller Scheduler - POST Submit\n");
-
- return (new ResponseEntity<String>(responseWrapper.getResponse(), HttpStatus.OK));
- }
-
- protected PostSubmitVnfChangeTimeSlotsWrapper postSubmitSchedulingRequest(JSONObject request, String path, String uuid) throws Exception {
-
- try {
- //STARTING REST API CALL AS AN FACTORY INSTACE
- System.out.println("<== Post Submit Scheduling Request START \n");
-
- PostSubmitVnfChangeRestObject<String> restObjStr = new PostSubmitVnfChangeRestObject<String>();
- String str = new String();
-
- restObjStr.set(str);
- restController.<String>Post(str, request, path, restObjStr);
-
- int status = restObjStr.getStatusCode();
- if (status >= 200 && status <= 299) {
- restObjStr.setUUID(uuid);
- }
-
- PostSubmitVnfChangeTimeSlotsWrapper responseWrapper = SchedulerUtil.postSubmitNewVnfWrapResponse(restObjStr);
-
- System.out.println("<== Post Submit Scheduling Request END : Response = " + responseWrapper.getResponse() + '\n');
-
- return responseWrapper;
-
- } catch (Exception e) {
- System.out.println("<== Post Submit Scheduling Request ERROR : " + e.toString() + '\n');
- throw e;
- }
- }
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java b/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java
deleted file mode 100755
index e23b99ba4..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/controller/ViewEditSubController.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.controller;
-
-
-import java.io.File;
-import java.text.DateFormat;
-import java.util.HashMap;
-import java.util.Map;
-
-
-
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.PathVariable;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.RequestMethod;
-import org.springframework.web.bind.annotation.RestController;
-import org.springframework.web.servlet.ModelAndView;
-
-import org.openecomp.portalsdk.core.controller.RestrictedBaseController;
-
-
-/**
- * The Class ViewEditSubController.
- */
-@RestController
-public class ViewEditSubController extends RestrictedBaseController{
-
- /** The view name. */
- String viewName;
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(ViewEditSubController.class);
-
- /** The model. */
- private Map<String, Object> model = new HashMap<String, Object>();
-
- /** The servlet context. */
- private @Autowired ServletContext servletContext;
-
- /**
- * Welcome.
- *
- * @param request the request
- * @return the model and view
- */
- @RequestMapping(value = {"/vieweditsub" }, method = RequestMethod.GET)
- public ModelAndView welcome(HttpServletRequest request) {
- return new ModelAndView("vieweditsub","model", model);
- // return new ModelAndView(getViewName());
- }
-
- /**
- * Post subscriber.
- *
- * @param request the request
- */
- @RequestMapping(value="/vieweditsub/subedit", method = RequestMethod.POST)
- public void PostSubscriber(HttpServletRequest request) {
-
- String subID = request.getParameter("subscriberID");
- model.put("subInfo", subID);
-
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#getViewName()
- */
- public String getViewName() {
- return viewName;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.portalsdk.core.controller.RestrictedBaseController#setViewName(java.lang.String)
- */
- public void setViewName(String viewName) {
- this.viewName = viewName;
- }
-
-
-
-
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java b/vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java
deleted file mode 100644
index 132c54ad9..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/model/ProxyResponse.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.openecomp.vid.model;
-
-/**
- * Created by Oren on 7/10/17.
- */
-public class ProxyResponse {
-
- protected String errorMessage;
-
- protected int httpCode;
-
- public String getErrorMessage() {
- return errorMessage;
- }
-
-
- public int getHttpCode() {
- return httpCode;
- }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java
deleted file mode 100644
index f6847e45d..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoBusinessLogic.java
+++ /dev/null
@@ -1,416 +0,0 @@
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.controller.MsoController;
-import org.openecomp.vid.mso.rest.*;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-import static org.openecomp.vid.controller.MsoController.SVC_INSTANCE_ID;
-import static org.openecomp.vid.controller.MsoController.REQUEST_TYPE;
-import static org.openecomp.vid.controller.MsoController.VNF_INSTANCE_ID;
-
-/**
- * Created by pickjonathan on 19/06/2017.
- */
-public class MsoBusinessLogic {
-
- /**
- * The Mso REST client
- * This should be replaced with mso client factory.
- */
- private MsoInterface msoClientInterface;
-
- /**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoController.class);
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- public MsoBusinessLogic() {
- msoClientInterface = MsoRestInterfaceFactory.getInstance();
- }
-
- // this function should get params from tosca and send them to instance at mso, then return success response.
- public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
- String methodName = "createSvcInstance ";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- return msoClientInterface.createSvcInstance(msoRequest, endpoint);
- }
-
- public MsoResponseWrapper createVnf(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
- String methodName = "createVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- return msoClientInterface.createVnf(requestDetails, vnf_endpoint);
- }
-
- public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception {
- String methodName = "createNwInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String nw_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- return msoClientInterface.createNwInstance(requestDetails, nw_endpoint);
- }
-
- public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
- String methodName = "createVolumeGroupInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- vnf_endpoint = vnf_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-
- return msoClientInterface.createVolumeGroupInstance(requestDetails, vnf_endpoint);
- }
-
- public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception{
- String methodName = "createVfModuleInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String partial_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- String vf_module_endpoint = partial_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-
- return msoClientInterface.createVfModuleInstance(requestDetails, vf_module_endpoint);
- }
-
- public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String serviceInstanceId) throws Exception{
- String methodName = "deleteSvcInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_SVC_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String svc_endpoint = endpoint + "/" + serviceInstanceId;
-
- return msoClientInterface.deleteSvcInstance(requestDetails, svc_endpoint);
- }
-
- public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception{
- String methodName = "deleteVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
- String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
-
- return msoClientInterface.deleteVnf(requestDetails, vnf_endpoint);
- }
-
- public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String vfModuleId) throws Exception{
- String methodName = "deleteVfModule";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VF_MODULE_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String vf__modules_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId).replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
-
- String delete_vf_endpoint = vf__modules_endpoint + '/' + vfModuleId;
-
- return msoClientInterface.deleteVfModule(requestDetails, delete_vf_endpoint);
- }
-
- public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId, String volumeGroupId)throws Exception{
- String methodName = "deleteVolumeGroupInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VOLUME_GROUP_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- String vnf_endpoint = svc_endpoint.replaceFirst(VNF_INSTANCE_ID, vnfInstanceId);
- String delete_volume_group_endpoint = vnf_endpoint + "/" + volumeGroupId;
-
- return msoClientInterface.deleteVolumeGroupInstance(requestDetails, delete_volume_group_endpoint);
- }
-
- public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String serviceInstanceId, String networkInstanceId) throws Exception{
- String methodName = "deleteNwInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_NETWORK_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
-
- String svc_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- String delete_nw_endpoint = svc_endpoint + "/" + networkInstanceId;
-
- return msoClientInterface.deleteNwInstance(requestDetails, delete_nw_endpoint);
- }
-
- public MsoResponseWrapper getOrchestrationRequest(String requestId)throws Exception{
- String methodName = "getOrchestrationRequest";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
- MsoResponseWrapper w = null;
- try {
- String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQ);
- String path = p + "/" + requestId;
-
- RestObject<String> restObjStr = new RestObject<String>();
- String str = new String();
- restObjStr.set(str);
-
- msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
-
- return MsoUtil.wrapResponse(restObjStr);
-
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- public MsoResponseWrapper getOrchestrationRequests(String filterString)throws Exception{
- String methodName = "getOrchestrationRequest";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
- MsoResponseWrapper w = null;
- try {
- String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
- String path = p + filterString;
-
- RestObject<String> restObjStr = new RestObject<String>();
- String str = new String();
- restObjStr.set(str);
-
- msoClientInterface.getOrchestrationRequest(str, "", path, restObjStr);
-
- return MsoUtil.wrapResponse(restObjStr);
-
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- public List<Request> getOrchestrationRequestsForDashboard()throws Exception{
- String methodName = "getOrchestrationRequestsForDashboard";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
- String path = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_ORC_REQS);
- path += "filter=modelType:EQUALS:vnf";
- RestObject<String> restObjStr = new RestObject<String>();
- String str = new String();
- restObjStr.set(str);
-
- MsoResponseWrapper msoResponseWrapper = msoClientInterface.getOrchestrationRequestsForDashboard(str, "", path, restObjStr);
- List<RequestWrapper> allOrchestrationRequests = deserializeOrchestrationRequestsJson(msoResponseWrapper.getEntity());
-
- List<Request> filteredOrchestrationRequests = new ArrayList<>();
- for (RequestWrapper currentRequest:allOrchestrationRequests){
- if ((currentRequest.getRequest() != null) && (currentRequest.getRequest().getRequestScope() == Request.RequestScope.VNF) && ((currentRequest.getRequest().getRequestType() ==
- Request.RequestType.REPLACE_INSTANCE)||(currentRequest.getRequest().getRequestType() ==
- Request.RequestType.UPDATE_INSTANCE) )) {
- filteredOrchestrationRequests.add(currentRequest.getRequest());
- }
- }
- return filteredOrchestrationRequests;
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
-
- }
-
- private List<RequestWrapper> deserializeOrchestrationRequestsJson(String orchestrationRequestsJson) throws Exception {
- String methodName = "deserializeOrchestrationRequestsJson";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- ObjectMapper mapper = new ObjectMapper();
- mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
- mapper.configure(DeserializationFeature.READ_ENUMS_USING_TO_STRING, true);
- RequestList requestList = mapper.readValue(orchestrationRequestsJson , RequestList.class);
- return requestList.getRequestList();
- }
-
-
- public List<Task> getManualTasksByRequestId(String originalRequestId)throws Exception{
- String methodName = "getManualTasksByRequestId";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
- String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
- String path = p + "?originalRequestId=" + originalRequestId;
-
- RestObject<String> restObjStr = new RestObject<String>();
- String str = new String();
- restObjStr.set(str);
-
- MsoResponseWrapper msoResponseWrapper = msoClientInterface.getManualTasksByRequestId(str, "", path, restObjStr);
- return deserializeManualTasksJson(msoResponseWrapper.getEntity());
-
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- private List<Task> deserializeManualTasksJson(String manualTasksJson) throws Exception{
- String methodName = "deserializeManualTasksJson";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- ObjectMapper mapper = new ObjectMapper();
- TaskList taskList = mapper.readValue(manualTasksJson , TaskList.class);
- return taskList.getTaskList();
- }
-
-
- public MsoResponseWrapper completeManualTask(RequestDetails requestDetails , String taskId)throws Exception{
- String methodName = "completeManualTask";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
- MsoResponseWrapper w = null;
- try {
- String p = SystemProperties.getProperty(MsoProperties.MSO_REST_API_GET_MAN_TASKS);
- String path = p + "/" + taskId + "/complete";
-
- RestObject<String> restObjStr = new RestObject<String>();
- String str = new String();
- restObjStr.set(str);
-
- msoClientInterface.completeManualTask(requestDetails , str, "", path, restObjStr);
-
- return MsoUtil.wrapResponse(restObjStr);
-
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- public MsoResponseWrapper activateServiceInstance(RequestDetails requestDetails , String serviceInstanceId)throws Exception{
- String methodName = "activateServiceInstance";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
- try {
- String path ="/" + serviceInstanceId + "/activate";
-
- RestObject<String> restObjStr = new RestObject<>();
- String str = "";
- restObjStr.set(str);
-
- msoClientInterface.activateServiceInstance(requestDetails , str, "", path, restObjStr);
-
- return MsoUtil.wrapResponse(restObjStr);
-
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
-
-
-
- private String validateEndpointPath(String endpointEnvVariable) throws Exception {
- String endpoint = SystemProperties.getProperty(endpointEnvVariable);
- if (endpoint == null || endpoint.isEmpty()) {
- throw new Exception(endpointEnvVariable + " env variable is not defined");
- }
- return endpoint;
- }
-
- public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
- String methodName = "updateVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
- String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- vnf_endpoint = vnf_endpoint + '/' + vnfInstanceId;
- return msoClientInterface.updateVnf(requestDetails, vnf_endpoint);
- }
-
- public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String serviceInstanceId, String vnfInstanceId) throws Exception {
- String methodName = "replaceVnf";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- String endpoint;
- try {
- endpoint = validateEndpointPath(MsoProperties.MSO_REST_API_VNF_CHANGE_MANAGEMENT_INSTANCE);
- } catch (Exception exception) {
- throw exception;
- }
- String vnf_endpoint = endpoint.replaceFirst(SVC_INSTANCE_ID, serviceInstanceId);
- vnf_endpoint = vnf_endpoint.replace(VNF_INSTANCE_ID, vnfInstanceId);
- vnf_endpoint = vnf_endpoint.replace(REQUEST_TYPE, "replace"); //No Constants file, TODO: once you create - add it.
- return msoClientInterface.replaceVnf(requestDetails, vnf_endpoint);
- }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java
deleted file mode 100644
index 0179400dc..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClient.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.openecomp.vid.mso;
-
-import org.apache.commons.io.IOUtils;
-import org.json.JSONObject;
-import org.json.JSONTokener;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.controller.VidController;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.core.MultivaluedHashMap;
-import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-/**
- * Created by pickjonathan on 20/06/2017.
- */
-public class MsoLocalClient implements MsoRestInterfaceIfc {
-
- /**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoLocalClient.class);
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /**
- * The client.
- */
- private static Client client = null;
-
- /**
- * The common headers.
- */
- private MultivaluedHashMap<String, Object> commonHeaders;
-
- /**
- * Instantiates a new mso rest interface.
- */
- public MsoLocalClient() {
- super();
- }
-
- public void initMsoClient() {
- final String methodname = "initRestClient()";
- }
-
- @Override
- public <T> void Get(T t, String sourceId, String path, RestObject<T> restObject) throws Exception {
-
- }
-
- @Override
- public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
- }
-
- @Override
- public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
- initMsoClient();
-
- final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_create_instance_response.json");
-
- t = (T) IOUtils.toString(asdcServicesFile);
- restObject.setStatusCode(200);
- restObject.set(t);
- }
-
- @Override
- public void logRequest(RequestDetails r) {
-
- }
-
- @Override
- public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject)
- throws Exception {
-
-
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java
deleted file mode 100644
index 1b15df721..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoLocalClientNew.java
+++ /dev/null
@@ -1,216 +0,0 @@
-package org.openecomp.vid.mso;
-
-import com.fasterxml.jackson.databind.DeserializationFeature;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang3.NotImplementedException;
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.mso.rest.*;
-
-import java.io.InputStream;
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-
-/**
- * Created by pickjonathan on 21/06/2017.
- */
-public class MsoLocalClientNew implements MsoInterface {
-
-
- /**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoLocalClient.class);
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
-
- @Override
- public MsoResponseWrapper createSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
-
- String methodName = "createSvcInstance ";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
- MsoResponseWrapper w = createInstance(requestDetails, "");
-
- return w;
- }
-
- public MsoResponseWrapper createInstance(RequestDetails request, String path) throws Exception {
- String methodName = "createInstance";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
- RestObject<String> restObjStr = new RestObject<String>();
-
- String str = new String();
-
- restObjStr.set(str);
-
- final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_create_instance_response.json");
-
- restObjStr.setStatusCode(200);
- restObjStr.set(IOUtils.toString(asdcServicesFile));
-
- MsoResponseWrapper w = MsoUtil.wrapResponse(restObjStr);
-
- return w;
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- @Override
- public MsoResponseWrapper createVnf(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper createNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper createVolumeGroupInstance(RequestDetails requestDetails, String path) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper createVfModuleInstance(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper deleteSvcInstance(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper deleteVnf(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper deleteVfModule(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper deleteVolumeGroupInstance(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public MsoResponseWrapper deleteNwInstance(RequestDetails requestDetails, String endpoint) throws Exception {
- return null;
- }
-
- @Override
- public void getOrchestrationRequest(String t, String sourceId, String endpoint, RestObject restObject) throws Exception { }
-
- @Override
- public MsoResponseWrapper getOrchestrationRequestsForDashboard(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
- String methodName = "getOrchestrationRequestsForDashboard";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
-
- final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_get_orchestration_requests.json");
-
- restObject.setStatusCode(200);
- restObject.set(IOUtils.toString(asdcServicesFile));
-
- MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
- return w;
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- public void activateServiceInstance(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject<String> restObject) throws Exception{
- String methodName = "activateServiceInstance";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
-
- final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_activate_service_instance.json");
-
- restObject.setStatusCode(200);
- restObject.set(IOUtils.toString(asdcServicesFile));
-
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
-
- @Override
- public MsoResponseWrapper getManualTasksByRequestId(String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
- String methodName = "getManualTasksByRequestId";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
-
- final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_get_manual_task_by_request_id.json");
-
- restObject.setStatusCode(200);
- restObject.set(IOUtils.toString(asdcServicesFile));
-
- MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
- return w;
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- @Override
- public MsoResponseWrapper completeManualTask(RequestDetails requestDetails, String t, String sourceId, String endpoint, RestObject restObject) throws Exception {
- String methodName = "getManualTasksByRequestId";
- logger.debug(dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- try {
-
- final InputStream asdcServicesFile = MsoLocalClient.class.getClassLoader().getResourceAsStream("mso_complete_manual_task.json");
-
- restObject.setStatusCode(200);
- restObject.set(IOUtils.toString(asdcServicesFile));
-
- MsoResponseWrapper w = MsoUtil.wrapResponse(restObject);
-
- return w;
- } catch (Exception e) {
- logger.error(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + "." + methodName + e.toString());
- throw e;
- }
- }
-
- @Override
- public MsoResponseWrapper replaceVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails, String vnf_endpoint) throws Exception {
- throw new NotImplementedException("Function was not implemented at this point.");
- }
-
-
-
- @Override
- public MsoResponseWrapper updateVnf(org.openecomp.vid.changeManagement.RequestDetails requestDetails,
- String vnf_endpoint) {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java
deleted file mode 100755
index b9f2dbcc9..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInt.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-/**
- * The Class MsoRestInt.
- */
-public class MsoRestInt {
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestInterface.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The request date format. */
- public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-
- /**
- * Instantiates a new mso rest int.
- */
- public MsoRestInt() {
- requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
- }
-
- /**
- * Log request.
- *
- * @param r the r
- */
- public void logRequest ( org.openecomp.vid.mso.rest.RequestDetails r ) {
- String methodName = "logRequest";
- ObjectMapper mapper = new ObjectMapper();
- String r_json_str = "";
- if ( r != null ) {
- r_json_str = r.toString();
- try {
- r_json_str = mapper.writeValueAsString(r);
- }
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse request as json");
- }
- }
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Request=(" + r_json_str + ")");
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java
deleted file mode 100755
index 5b331e908..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterface.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Collections;
-import java.util.Date;
-
-import javax.ws.rs.client.Client;
-import javax.ws.rs.client.Entity;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.MultivaluedHashMap;
-import javax.ws.rs.core.Response;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-
-import org.apache.commons.codec.binary.Base64;
-import org.eclipse.jetty.util.security.Password;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.client.HttpBasicClient;
-import org.openecomp.vid.client.HttpsBasicClient;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-/**
- * The Class MsoRestInterface.
- */
-public class MsoRestInterface extends MsoRestInt implements MsoRestInterfaceIfc {
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoRestInterface.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The client. */
- private static Client client = null;
-
- /** The common headers. */
- private MultivaluedHashMap<String, Object> commonHeaders;
-
- /**
- * Instantiates a new mso rest interface.
- */
- public MsoRestInterface() {
- super();
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#initRestClient()
- */
- public void initMsoClient()
- {
- final String methodname = "initRestClient()";
-
- final String username = SystemProperties.getProperty(MsoProperties.MSO_USER_NAME);
- final String password = SystemProperties.getProperty(MsoProperties.MSO_PASSWORD);
- final String mso_url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL);
- final String decrypted_password = Password.deobfuscate(password);
-
- String authString = username + ":" + decrypted_password;
-
- byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
- String authStringEnc = new String(authEncBytes);
-
- commonHeaders = new MultivaluedHashMap<String, Object> ();
- commonHeaders.put("Authorization", Collections.singletonList((Object) ("Basic " + authStringEnc)));
- //Pass calling application identifier to SO
- commonHeaders.put("X-FromAppId",
- Collections.singletonList(SystemProperties.getProperty(SystemProperties.APP_DISPLAY_NAME)));
-
- boolean use_ssl = true;
- if ( (mso_url != null) && ( !(mso_url.isEmpty()) ) ) {
- if ( mso_url.startsWith("https")) {
- use_ssl = true;
- }
- else {
- use_ssl = false;
- }
- }
- if (client == null) {
-
- try {
- if ( use_ssl ) {
- //logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodname + " getting HttpsBasicClient with username=" + username
- // + " password=" + password);
- client = HttpsBasicClient.getClient();
- }
- else {
- //logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodname + " getting HttpsBasicClient with username=" + username
- // + " password=" + password);
- client = HttpBasicClient.getClient();
- }
- } catch (Exception e) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + methodname + " Unable to get the SSL client");
- }
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Get(java.lang.Object, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
- */
- @SuppressWarnings("unchecked")
- public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception {
- String methodName = "Get";
-
- logger.debug(EELFLoggerDelegate.debugLogger, methodName + " start");
-
- String url="";
- restObject.set(t);
-
- url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
-
- initMsoClient();
-
- final Response cres = client.target(url)
- .request()
- .accept("application/json")
- .headers(commonHeaders)
- .get();
-
- int status = cres.getStatus();
- restObject.setStatusCode (status);
-
- if (status == 200) {
- t = (T) cres.readEntity(t.getClass());
- restObject.set(t);
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + methodName + " REST api was successfull!");
-
- } else {
- throw new Exception(methodName + " with status="+ status + ", url= " + url );
- }
-
- logger.debug(EELFLoggerDelegate.debugLogger,methodName + " received status=" + status );
-
- return;
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Delete(java.lang.Object, org.openecomp.vid.mso.rest.RequestDetails, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
- */
- @SuppressWarnings("unchecked")
- public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) {
-
- String methodName = "Delete";
- String url="";
- Response cres = null;
-
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
- logRequest (r);
-
- try {
- initMsoClient();
-
- url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + " methodName sending request to: " + url);
-
- cres = client.target(url)
- .request()
- .accept("application/json")
- .headers(commonHeaders)
- //.entity(r)
- .build("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON)).invoke();
- // .method("DELETE", Entity.entity(r, MediaType.APPLICATION_JSON));
- //.delete(Entity.entity(r, MediaType.APPLICATION_JSON));
-
- int status = cres.getStatus();
- restObject.setStatusCode (status);
-
- if (status == 404) { // resource not found
- String msg = "Resource does not exist...: " + cres.getStatus();
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
- } else if (status == 200 || status == 204){
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + "Resource " + url + " deleted");
- } else if (status == 202) {
- String msg = "Delete in progress: " + status;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
- }
- else {
- String msg = "Deleting Resource failed: " + status;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + msg);
- }
-
- try {
- t = (T) cres.readEntity(t.getClass());
- restObject.set(t);
- }
- catch ( Exception e ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
- + e.getMessage());
- }
-
- }
- catch (Exception e)
- {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
- throw e;
-
- }
- }
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Post(java.lang.Object, org.openecomp.vid.mso.rest.RequestDetails, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
- */
- @SuppressWarnings("unchecked")
- public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
- String methodName = "Post";
- String url="";
-
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
-
- logRequest (r);
- try {
-
- initMsoClient();
-
- url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
- // Change the content length
- final Response cres = client.target(url)
- .request()
- .accept("application/json")
- .headers(commonHeaders)
- //.header("content-length", 201)
- //.header("X-FromAppId", sourceID)
- .post(Entity.entity(r, MediaType.APPLICATION_JSON));
-
- try {
- t = (T) cres.readEntity(t.getClass());
- restObject.set(t);
- }
- catch ( Exception e ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
- + e.getMessage());
- }
-
- int status = cres.getStatus();
- restObject.setStatusCode (status);
-
- if ( status >= 200 && status <= 299 ) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-
- } else {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
- }
-
- } catch (Exception e)
- {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
- throw e;
-
- }
- }
-
-
- /* (non-Javadoc)
- * @see org.openecomp.vid.mso.MsoRestInterfaceIfc#Put(java.lang.Object, org.openecomp.vid.mso.rest.RequestDetails, java.lang.String, java.lang.String, org.openecomp.vid.mso.RestObject)
- */
- @SuppressWarnings("unchecked")
- public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject) throws Exception {
-
- String methodName = "Put";
- String url="";
-
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-// logRequest (r);
- try {
-
- initMsoClient();
-
- url = SystemProperties.getProperty(MsoProperties.MSO_SERVER_URL) + path;
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " sending request to url= " + url);
- // Change the content length
- final Response cres = client.target(url)
- .request()
- .accept("application/json")
- .headers(commonHeaders)
- //.header("content-length", 201)
- //.header("X-FromAppId", sourceID)
- .put(Entity.entity(r, MediaType.APPLICATION_JSON));
-
- try {
- t = (T) cres.readEntity(t.getClass());
- restObject.set(t);
- }
- catch ( Exception e ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " No response entity, this is probably ok, e="
- + e.getMessage());
- }
-
- int status = cres.getStatus();
- restObject.setStatusCode (status);
-
- if ( status >= 200 && status <= 299 ) {
- logger.info(EELFLoggerDelegate.errorLogger, dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " REST api POST was successful!");
-
- } else {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with status="+status+", url="+url);
- }
-
- } catch (Exception e)
- {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " with url="+url+ ", Exception: " + e.toString());
- throw e;
-
- }
- }
-
-
- /**
- * Gets the single instance of MsoRestInterface.
- *
- * @param <T> the generic type
- * @param clazz the clazz
- * @return single instance of MsoRestInterface
- * @throws IllegalAccessException the illegal access exception
- * @throws InstantiationException the instantiation exception
- */
- public <T> T getInstance(Class<T> clazz) throws IllegalAccessException, InstantiationException
- {
- return clazz.newInstance();
- }
-
-
-
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java
deleted file mode 100755
index 4ff13eddd..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceIfc.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.mso.rest.RequestDetails;
-
-/**
- * The Interface MsoRestInterfaceIfc.
- */
-public interface MsoRestInterfaceIfc {
-
- /**
- * Inits the rest client.
- */
- public void initMsoClient();
-
- /**
- * Gets the.
- *
- * @param <T> the generic type
- * @param t the t
- * @param sourceId the source id
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
- */
- public <T> void Get (T t, String sourceId, String path, RestObject<T> restObject ) throws Exception;
-
- /**
- * Delete.
- *
- * @param <T> the generic type
- * @param t the t
- * @param r the r
- * @param sourceID the source ID
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
- */
- public <T> void Delete(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
- /**
- * Post.
- *
- * @param <T> the generic type
- * @param t the t
- * @param r the r
- * @param sourceID the source ID
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
- */
- public <T> void Post(T t, RequestDetails r, String sourceID, String path, RestObject<T> restObject) throws Exception;
-
- /**
- * Put.
- *
- * @param <T> the generic type
- * @param t the t
- * @param r the r
- * @param sourceID the source ID
- * @param path the path
- * @param restObject the rest object
- * @throws Exception the exception
- */
- public <T> void Put(T t, ChangeManagementRequest r, String sourceID, String path, RestObject<T> restObject) throws Exception ;
- /***
- * Log request.
- *
- * @param r the r
- */
- public void logRequest ( RequestDetails r );
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java
deleted file mode 100755
index 881409e1a..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/RestObject.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-/**
- * The Class RestObject.
- *
- * @param <T> the generic type
- */
-public class RestObject<T> {
-
- /**
- * Generic version of the RestObject class.
- *
- */
- // T stands for "Type"
- private T t;
-
- /** The status code. */
- private int statusCode= 0;
-
- /**
- * Sets the.
- *
- * @param t the t
- */
- public void set(T t) { this.t = t; }
-
- /**
- * Gets the.
- *
- * @return the t
- */
- public T get() { return t; }
-
- /**
- * Sets the status code.
- *
- * @param v the new status code
- */
- public void setStatusCode(int v) { this.statusCode = v; }
-
- /**
- * Gets the status code.
- *
- * @return the status code
- */
- public int getStatusCode() { return this.statusCode; }
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java b/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java
deleted file mode 100644
index 1afb2df21..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/rest/MsoBusinessLogicNew.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package org.openecomp.vid.mso.rest;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.mso.MsoClientFactory;
-import org.openecomp.vid.mso.MsoInterface;
-import org.openecomp.vid.mso.MsoResponseWrapper;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-/**
- * Created by pickjonathan on 21/06/2017.
- * This class was created only for testing the new logic.
- * It is not used by any of the controllers binded to the ui.
- * This can be deleted in the future in order to keep a cleaner project.
- * If deleting please dont forget to delete the controllers, factory and all involved in the assert test.
- */
-public class MsoBusinessLogicNew {
-
- /**
- * \
- * The MSO Client
- */
- private MsoInterface msoClient;
-
- private MsoInterface msoRestTempClient;
-
- /**
- * The logger.
- */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(MsoBusinessLogicNew.class);
-
- /**
- * The Constant dateFormat.
- */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- public MsoBusinessLogicNew() {
- msoClient = MsoClientFactory.getInstance();
- msoRestTempClient = new MsoRestClientNew();
- }
-
- public MsoResponseWrapper createSvcInstance(RequestDetails msoRequest) throws Exception {
- String methodName = "createSvcInstance ";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-// String endpoint = SystemProperties.getProperty(MsoProperties.MSO_REST_API_SVC_INSTANCE);
-//
-// MsoResponseWrapper w = createInstance(msoRequest, p);
-
- MsoResponseWrapper w = msoClient.createSvcInstance(msoRequest, "");
-
- return w;
- }
-
-
- public MsoResponseWrapper createSvcInstanceRest(RequestDetails msoRequest) throws Exception {
- String methodName = "createSvcInstance ";
- logger.debug(EELFLoggerDelegate.debugLogger, dateFormat.format(new Date()) + "<== " + methodName + " start");
-
-
- MsoResponseWrapper w = msoRestTempClient.createSvcInstance(msoRequest, "");
-
- return w;
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java b/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java
deleted file mode 100644
index 2ed5bdbbf..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/roles/RoleProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.openecomp.vid.roles;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.portalsdk.core.web.support.UserUtils;
-
-import javax.servlet.http.HttpServletRequest;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-/**
- * Created by Oren on 7/1/17.
- */
-public class RoleProvider {
-
- private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(RoleProvider.class);
- final String readPermissionString = "read";
- final String roleStringDelimiter = "_";
-
- public static List<String> extractRoleFromSession(HttpServletRequest request) {
-
- return new ArrayList<String>();
-
- }
-
- public List<Role> getUserRoles(HttpServletRequest request) {
- List<Role> roleList = new ArrayList<>();
- //Disable roles until AAF integration finishes
- /*HashMap roles = UserUtils.getRoles(request);
- for (Object role : roles.keySet()) {
- org.openecomp.portalsdk.core.domain.Role sdkRol = (org.openecomp.portalsdk.core.domain.Role) roles.get(role);
- try {
- if (sdkRol.getName().contains(readPermissionString))
- continue;
- String[] roleParts = splitRole((sdkRol.getName()));
- roleList.add(createRoleFromStringArr(roleParts));
- } catch (Exception e) {
- LOG.error("Failed to parse permission", e);
-
- }
- }*/
-
- return roleList;
- }
-
- public String[] splitRole(String roleAsString) {
- return roleAsString.split(roleStringDelimiter);
- }
-
- public boolean userPermissionIsReadOnly(List<Role> roles) {
-
- return (!(roles.size() > 0));
- }
-
- public Role createRoleFromStringArr(String[] roleParts) {
- if (roleParts.length > 2) {
- return new Role(EcompRole.READ, roleParts[0], roleParts[1], roleParts[2]);
- } else {
- return new Role(EcompRole.READ, roleParts[0], roleParts[1], null);
- }
- }
-
-}
-
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java
deleted file mode 100644
index 614b557a0..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/GetTimeSlotsRestObject.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-public class GetTimeSlotsRestObject<T> extends org.openecomp.vid.scheduler.RestObject<T> {
-
- public String uuid;
-
- public void setUUID(String uuid) { this.uuid = uuid; }
-
- public String getUUID() { return this.uuid; }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java
deleted file mode 100644
index 86cbab8a6..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostCreateNewVnfRestObject.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-public class PostCreateNewVnfRestObject<T> extends RestObject<T> {
-
- public String uuid;
-
- public void setUUID(String uuid) { this.uuid = uuid; }
-
- public String getUUID() { return this.uuid; }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java
deleted file mode 100644
index 6fb56f67d..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/RestObjects/PostSubmitVnfChangeRestObject.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.openecomp.vid.scheduler.RestObjects;
-
-public class PostSubmitVnfChangeRestObject<T> extends RestObject<T> {
-
- public String uuid;
-
- public void setUUID(String uuid) { this.uuid = uuid; }
-
- public String getUUID() { return this.uuid; }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java
deleted file mode 100644
index 5f148c06b..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrapper.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Scheduler response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "status",
- "entity",
- "uuid"
-})
-
-public class SchedulerResponseWrapper {
-
- @JsonProperty("status")
- private int status;
-
- @JsonProperty("entity")
- private String entity;
-
- @JsonProperty("uuid")
- private String uuid;
-
- @JsonProperty("entity")
- public String getEntity() {
- return entity;
- }
-
- @JsonProperty("status")
- public int getStatus() {
- return status;
- }
-
- @JsonProperty("uuid")
- public String getUuid() {
- return uuid;
- }
-
- @JsonProperty("status")
- public void setStatus(int v) {
- this.status = v;
- }
-
- @JsonProperty("entity")
- public void setEntity(String v) {
- this.entity = v;
- }
-
- @JsonProperty("uuid")
- public void setUuid(String v) {
- this.uuid = v;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- public String getResponse () {
-
- StringBuilder b = new StringBuilder ("{ \"status\": ");
- b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
- return (b.toString());
- }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java
deleted file mode 100644
index e5001d41f..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/GetTimeSlotsWrapper.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-public class GetTimeSlotsWrapper extends SchedulerResponseWrapper {
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java
deleted file mode 100644
index f1baeaf6e..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostCreateNewVnfWrapper.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "uuid"
-})
-public class PostCreateNewVnfWrapper extends SchedulerResponseWrapper {
-
- @JsonProperty("uuid")
- private String uuid;
-
- @JsonProperty("uuid")
- public String getUuid() {
- return uuid;
- }
-
- @JsonProperty("uuid")
- public void setUuid(String v) {
- this.uuid = v;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- public String getResponse () {
-
- StringBuilder b = new StringBuilder ("{ \"status\": ");
- b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
- return (b.toString());
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java
deleted file mode 100644
index 86e4c0a74..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/PostSubmitVnfChangeTimeSlotsWrapper.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "uuid"
-})
-public class PostSubmitVnfChangeTimeSlotsWrapper extends SchedulerResponseWrapper {
- @JsonProperty("uuid")
- private String uuid;
-
- @JsonProperty("uuid")
- public String getUuid() {
- return uuid;
- }
-
- @JsonProperty("uuid")
- public void setUuid(String v) {
- this.uuid = v;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- public String getResponse () {
-
- StringBuilder b = new StringBuilder ("{ \"status\": ");
- b.append(getStatus()).append(", \"entity\": \" " ).append(this.getEntity()).append("\" ,\"uuid\": \"" ).append(this.getUuid()).append("\"}");
- return (b.toString());
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java
deleted file mode 100644
index 081ed3dc4..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerResponseWrappers/SchedulerResponseWrapper.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.openecomp.vid.scheduler.SchedulerResponseWrappers;
-
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/**
- * This wrapper encapsulates the Scheduler response
- */
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "status",
- "entity"
-})
-
-public class SchedulerResponseWrapper {
-
- @JsonProperty("status")
- private int status;
-
- @JsonProperty("entity")
- private String entity;
-
- @JsonProperty("entity")
- public String getEntity() {
- return entity;
- }
-
- @JsonProperty("status")
- public int getStatus() {
- return status;
- }
-
- @JsonProperty("status")
- public void setStatus(int v) {
- this.status = v;
- }
-
- @JsonProperty("entity")
- public void setEntity(String v) {
- this.entity = v;
- }
-
- @Override
- public String toString() {
- return ToStringBuilder.reflectionToString(this);
- }
-
- public String getResponse () {
-
- StringBuilder b = new StringBuilder ("{ \"status\": ");
-
- b.append(getStatus()).append(", \"entity\": " ).append(this.getEntity()).append("}");
- return (b.toString());
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java
deleted file mode 100644
index 32b3a9c8c..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerRestInt.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-
-public class SchedulerRestInt {
-
- /** The logger. */
- EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerRestInterface.class);
-
- /** The Constant dateFormat. */
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- /** The request date format. */
- public DateFormat requestDateFormat = new SimpleDateFormat("EEE, dd MMM YYYY HH:mm:ss z");
-
- public SchedulerRestInt() {
- requestDateFormat.setTimeZone(java.util.TimeZone.getTimeZone("GMT"));
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
deleted file mode 100644
index f82f474f6..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/SchedulerUtil.java
+++ /dev/null
@@ -1,100 +0,0 @@
-package org.openecomp.vid.scheduler;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.GetTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostCreateNewVnfWrapper;
-import org.openecomp.vid.scheduler.SchedulerResponseWrappers.PostSubmitVnfChangeTimeSlotsWrapper;
-import org.openecomp.vid.scheduler.SchedulerUtil;
-import org.openecomp.vid.scheduler.RestObjects.GetTimeSlotsRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostCreateNewVnfRestObject;
-import org.openecomp.vid.scheduler.RestObjects.PostSubmitVnfChangeRestObject;
-
-import com.fasterxml.jackson.databind.ObjectMapper;
-
-public class SchedulerUtil {
-
- private static EELFLoggerDelegate logger = EELFLoggerDelegate.getLogger(SchedulerUtil.class);
-
- final static DateFormat dateFormat = new SimpleDateFormat("HH:mm:ss:SSSS");
-
- public static GetTimeSlotsWrapper getTimeSlotsWrapResponse (GetTimeSlotsRestObject<String> rs) {
-
- String resp_str = "";
- int status = 0;
-
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- }
-
- GetTimeSlotsWrapper w = new GetTimeSlotsWrapper();
-
- w.setEntity(resp_str);
- w.setStatus (status);
-
- return (w);
- }
-
- public static PostSubmitVnfChangeTimeSlotsWrapper postSubmitNewVnfWrapResponse (PostSubmitVnfChangeRestObject<String> rs) {
-
- String resp_str = "";
- int status = 0;
- String uuid = "";
-
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- uuid = rs.getUUID();
- }
-
- PostSubmitVnfChangeTimeSlotsWrapper w = new PostSubmitVnfChangeTimeSlotsWrapper();
-
- w.setEntity(resp_str);
- w.setStatus (status);
- w.setUuid(uuid);
-
- return (w);
- }
-
- public static PostCreateNewVnfWrapper postCreateNewVnfWrapResponse (PostCreateNewVnfRestObject<String> rs) {
-
- String resp_str = "";
- int status = 0;
- String uuid = "";
-
- if ( rs != null ) {
- resp_str = rs.get();
- status = rs.getStatusCode();
- uuid = rs.getUUID();
- }
-
- PostCreateNewVnfWrapper w = new PostCreateNewVnfWrapper();
-
- w.setEntity(resp_str);
- w.setStatus (status);
- w.setUuid(uuid);
-
- return (w);
- }
-
- public static <T> String convertPojoToString ( T t ) throws com.fasterxml.jackson.core.JsonProcessingException {
-
- String methodName = "convertPojoToString";
- ObjectMapper mapper = new ObjectMapper();
- String r_json_str = "";
- if ( t != null ) {
- try {
- r_json_str = mapper.writeValueAsString(t);
- }
- catch ( com.fasterxml.jackson.core.JsonProcessingException j ) {
- logger.debug(EELFLoggerDelegate.debugLogger,dateFormat.format(new Date()) + "<== " + methodName + " Unable to parse object as json");
- }
- }
- return (r_json_str);
- }
-
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java b/vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java
deleted file mode 100644
index 746fd9b24..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/scheduler/rest/RequestDetails.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.scheduler.rest;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.List;
-//import javax.annotation.Generated;
-
-import org.openecomp.vid.domain.mso.CloudConfiguration;
-import org.openecomp.vid.domain.mso.ModelInfo;
-import org.openecomp.vid.domain.mso.RequestInfo;
-import org.openecomp.vid.domain.mso.RequestParameters;
-import org.openecomp.vid.domain.mso.SubscriberInfo;
-import com.fasterxml.jackson.annotation.JsonAnyGetter;
-import com.fasterxml.jackson.annotation.JsonAnySetter;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonProperty;
-import com.fasterxml.jackson.annotation.JsonPropertyOrder;
-import org.apache.commons.lang.builder.EqualsBuilder;
-import org.apache.commons.lang.builder.HashCodeBuilder;
-import org.apache.commons.lang.builder.ToStringBuilder;
-
-/*
- * "domain" : "ChangeManagement",
- "scheduleId" : "3569b875-d40e-4adb-a288-a74f4b59ec1c",
- "scheduleName" : "VnfUpgrade/DWF",
- "userId" : "jf9860@att.com",
- "domainData" : {
- "WorkflowName" : "HEAT Stack Software Update for vNFs"
- },
- "status" : "PendingOptimization",
- "schedulingInfo" : {
- "scheduleId" : "ChangeManagement.3569b875-d40e-4adb-a288-a74f4b59ec1c",
- "normalDurationInSecs" : 60,
- "AdditionalDurationInSecs" : 0,
- "concurrencyLimit" : 10,
- "policyId" : ["SNIRO.TimeLimitAndVerticalTopology"],
- "groups" : [{
- "groupId" : " group1",
- "node" : ["satmo415vbc", "satmo455vbc"],
- "changeWindows" : [{
- "startTime" : "2017-02-15T01:00:00Z",
- "finishTime" : "2017-02-15T02:00:00Z"
- }
- ]
- }, {
- "groupId" : " group2",
- "node" : ["satmo555vbc"],
- "changeWindows" : [{
- "startTime" : "2017-02-15T01:00:00Z",
- "finishTime" : "2017-02-15T02:00:00Z"
- }, {
- "startTime" : "2017-02-15T05:00:00Z",
- "finishTime" : "2017-02-15T05:30:00Z"
- }
- ]
- }
- ]
-*/
-@JsonInclude(JsonInclude.Include.NON_NULL)
-@JsonPropertyOrder({
- "domain",
- "scheduleId",
- "scheduleName",
- "userId",
- "domainData",
- "status",
- "schcedulingInfo"
-})
-public class RequestDetails {
-
- @JsonProperty("domain")
- private String domain;
-
-
-
- @JsonProperty("domain")
- public String getDomain() {
- return domain;
- }
-
- @JsonProperty("domain")
- public void setDomain(String domain) {
- this.domain = domain;
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java b/vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java
deleted file mode 100644
index d3bacadec..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiService.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.aai.AaiResponse;
-import org.openecomp.vid.aai.SubscriberFilteredResults;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.roles.RoleValidator;
-
-import javax.ws.rs.core.Response;
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public interface AaiService {
-
-
- SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator);
-
- AaiResponse getSubscriberData(String subscriberId, RoleValidator roleValidator);
-
- AaiResponse getServices(RoleValidator roleValidator);
-
- AaiResponse getAaiZones();
-
- AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId);
-
- Response getVNFData(String globalSubscriberId, String serviceType);
-
- AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator);
-
- AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId);
-
- Response getVersionByInvariantId(List<String> modelInvariantId);
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java
deleted file mode 100644
index cb0962869..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/AaiServiceImpl.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.ecomp.aai.model.AaiAICZones.AicZones;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.aai.*;
-import org.openecomp.vid.aai.model.AaiGetServicesRequestModel.*;
-import org.openecomp.vid.aai.model.AaiGetTenatns.GetTenantsResponse;
-import org.openecomp.vid.model.*;
-import org.openecomp.vid.roles.RoleValidator;
-import org.openecomp.vid.scheduler.SchedulerProperties;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.ResponseEntity;
-
-import javax.ws.rs.core.Response;
-
-import java.util.List;
-
-/**
- * Created by Oren on 7/4/17.
- */
-public class AaiServiceImpl implements AaiService {
-
-
- @Autowired
- private AaiClientInterface aaiClient;
-
-
- @Override
- public SubscriberFilteredResults getFullSubscriberList(RoleValidator roleValidator) {
- AaiResponse<SubscriberList> subscriberResponse = aaiClient.getAllSubscribers();
- SubscriberFilteredResults subscriberFilteredResults =
- new SubscriberFilteredResults(roleValidator,subscriberResponse.getT(),
- subscriberResponse.getErrorMessage(),
- subscriberResponse.getHttpCode());
-
- return subscriberFilteredResults;
- }
-
- @Override
- public AaiResponse getSubscriberData(String subscriberId, RoleValidator roleProvider) {
- AaiResponse<Services> subscriberResponse = aaiClient.getSubscriberData(subscriberId);
- String subscriberGlobalId = subscriberResponse.getT().globalCustomerId;
- for (ServiceSubscription serviceSubscription : subscriberResponse.getT().serviceSubscriptions.serviceSubscription) {
- String serviceType = serviceSubscription.serviceType;
- serviceSubscription.isPermitted = roleProvider.isServicePermitted(subscriberGlobalId,serviceType);
- }
- return subscriberResponse;
-
- }
-
- @Override
- public Response getVersionByInvariantId(List<String> modelInvariantId) {
- try {
- return aaiClient.getVersionByInvariantId(modelInvariantId);
- }catch (Exception e){
- e.printStackTrace();
- }
- return null;
- }
-
- @Override
- public AaiResponse getServices(RoleValidator roleValidator) {
- AaiResponse<GetServicesAAIRespone> subscriberResponse = aaiClient.getServices();
- for (org.openecomp.vid.aai.model.AaiGetServicesRequestModel.Service service :subscriberResponse.getT().service){
- service.isPermitted = true;
- }
- return subscriberResponse;
- }
-
- @Override
- public AaiResponse<GetTenantsResponse[]> getTenants(String globalCustomerId, String serviceType, RoleValidator roleValidator) {
- AaiResponse<GetTenantsResponse[]> aaiGetTenantsResponse = aaiClient.getTenants(globalCustomerId,serviceType);
- GetTenantsResponse[] tenants = aaiGetTenantsResponse.getT();
- for (int i=0;i<tenants.length;i++){
- tenants[i].isPermitted = roleValidator.isTenantPermitted(globalCustomerId,serviceType, tenants[i].tenantID);
- }
- return aaiGetTenantsResponse;
- }
-
- @Override
- public AaiResponse getVNFData(String globalSubscriberId, String serviceType, String serviceInstanceId) {
- return aaiClient.getVNFData(globalSubscriberId,serviceType,serviceInstanceId);
- }
-
- @Override
- public Response getVNFData(String globalSubscriberId, String serviceType) {
- return aaiClient.getVNFData(globalSubscriberId,serviceType);
- }
-
- @Override
- public AaiResponse getAaiZones() {
- AaiResponse<AicZones> response = aaiClient.getAllAicZones();
- return response;
- }
-
- @Override
- public AaiResponse getAicZoneForPnf(String globalCustomerId , String serviceType , String serviceId) {
- AaiResponse<AicZones> response = aaiClient.getAicZoneForPnf(globalCustomerId , serviceType , serviceId);
- return response;
- }
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java b/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java
deleted file mode 100644
index 3ac528282..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementService.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.json.simple.JSONArray;
-import org.openecomp.vid.mso.rest.Request;
-import org.springframework.http.ResponseEntity;
-
-import java.util.Collection;
-
-public interface ChangeManagementService {
- Collection<Request> getMSOChangeManagements();
- ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName);
- JSONArray getSchedulerChangeManagements();
-}
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java b/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java
deleted file mode 100644
index 7e69d8fec..000000000
--- a/vid-app-common/src/main/java/org/openecomp/vid/services/ChangeManagementServiceImpl.java
+++ /dev/null
@@ -1,109 +0,0 @@
-package org.openecomp.vid.services;
-
-import org.openecomp.portalsdk.core.logging.logic.EELFLoggerDelegate;
-import org.openecomp.vid.changeManagement.ChangeManagementRequest;
-import org.openecomp.vid.changeManagement.RequestDetails;
-import org.openecomp.vid.mso.MsoBusinessLogic;
-import org.openecomp.vid.mso.MsoResponseWrapper;
-import org.openecomp.vid.controller.MsoController;
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.scheduler.*;
-
-import org.springframework.http.HttpStatus;
-import org.springframework.http.ResponseEntity;
-import org.openecomp.vid.mso.rest.Request;
-import org.springframework.stereotype.Service;
-import org.json.simple.JSONArray;
-import org.json.simple.parser.JSONParser;
-
-import java.util.Date;
-import java.util.List;
-import java.util.Collection;
-
-
-@Service
-public class ChangeManagementServiceImpl implements ChangeManagementService {
- @Override
- public Collection<Request> getMSOChangeManagements() {
- Collection<Request> result = null;
- MsoBusinessLogic msoBusinessLogic = new MsoBusinessLogic();
- try {
- result = msoBusinessLogic.getOrchestrationRequestsForDashboard();
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return result;
- }
-
- private RequestDetails findRequestByVnfName(List<RequestDetails> requests, String vnfName){
-
- if (requests == null)
- return null;
-
- for(RequestDetails requestDetails: requests){
- if(requestDetails.getVnfName().equals(vnfName)){
- return requestDetails;
- }
- }
-
- return null;
- }
-
- @Override
- public ResponseEntity<String> doChangeManagement(ChangeManagementRequest request, String vnfName) {
- if (request == null)
- return null;
- ResponseEntity<String> response = null;
- RequestDetails currentRequestDetails = findRequestByVnfName(request.getRequestDetails(), vnfName);
- MsoResponseWrapper msoResponseWrapperObject = null;
- if(currentRequestDetails != null){
- MsoBusinessLogic msoBusinessLogicObject = new MsoBusinessLogic();
- String serviceInstanceId = currentRequestDetails.getRelatedInstList().get(0).getRelatedInstance().getInstanceId();
- String vnfInstanceId = currentRequestDetails.getVnfInstanceId();
- try {
- if (request.getRequestType().equalsIgnoreCase("update")) {
-
- msoResponseWrapperObject = msoBusinessLogicObject.updateVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
- }
- else if (request.getRequestType().equalsIgnoreCase("replace"))
- {
- msoResponseWrapperObject = msoBusinessLogicObject.replaceVnf(currentRequestDetails, serviceInstanceId, vnfInstanceId);
-// throw new NotImplementedException();
- }
- response = new ResponseEntity<String>(msoResponseWrapperObject.getResponse(), HttpStatus.OK);
- return response;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- }
-
- // AH:TODO: return ChangeManagementResponse
- return null;
- }
-
- @Override
- public JSONArray getSchedulerChangeManagements() {
- JSONArray result = null;
- try {
- String path = SystemProperties.getProperty(SchedulerProperties.SCHEDULER_GET_SCHEDULES);
- org.openecomp.vid.scheduler.RestObject<String> restObject = new org.openecomp.vid.scheduler.RestObject<>();
- SchedulerRestInterfaceIfc restClient = SchedulerRestInterfaceFactory.getInstance();
-
- String str = new String();
- restObject.set(str);
- restClient.Get(str, "", path, restObject);
- String restCallResult = restObject.get();
- JSONParser parser = new JSONParser();
- Object parserResult = parser.parse(restCallResult);
- result = (JSONArray) parserResult;
- } catch (Exception e) {
- e.printStackTrace();
- }
-
- return result;
- }
-
-
-}
diff --git a/vid-app-common/src/main/resources/2f80c596.zip b/vid-app-common/src/main/resources/2f80c596.zip
new file mode 100644
index 000000000..30935c6b9
--- /dev/null
+++ b/vid-app-common/src/main/resources/2f80c596.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/aai_config_instance_view_edit.json b/vid-app-common/src/main/resources/aai_config_instance_view_edit.json
new file mode 100644
index 000000000..7920c6dfb
--- /dev/null
+++ b/vid-app-common/src/main/resources/aai_config_instance_view_edit.json
@@ -0,0 +1,81 @@
+{
+ "model-name":"Proxy-Config-Instance",
+ "configuration":{
+ "configuration-id": "9533-config-LB1113",
+ "configuration-name": "configuration-name-9533",
+ "configuration-type": "configuration-type-9533",
+ "configuration-sub-type": "configuration-sub-type-9533",
+ "model-invariant-id": "model-invariant-id-9533",
+ "model-version-id": "model-version-id-9533",
+ "orchestration-status": "Active",
+ "operational-status": "",
+ "configuration-selflink": "",
+ "model-customization-id": "model-customization-id-9533",
+ "resource-version": "1504038855716"
+ },
+ "extra-properties": {
+ },
+ "inventory-response-items":{
+ "inventory-response-item":[
+ {
+ "model-name":"VidPcrf051517..pcrf_nimbus_pcm..module-4",
+ "l-interface": {
+ "interface-name": "9533lInterface-LB1113",
+ "interface-role": "8ni",
+ "v6-wan-link-ip": "Pnr",
+ "selflink": "Un56B",
+ "interface-id": "o74n",
+ "macaddr": "8an6",
+ "network-name": "kjOn",
+ "management-option": "0Rn7",
+ "interface-description": "XPnLr",
+ "is-port-mirrored": true,
+ "resource-version": "1504038598348",
+ "in-maint": false,
+ "is-ip-unnumbered": false,
+ "relationship-list": {
+ "relationship": [
+ {
+ "related-to": "logical-link",
+ "related-link": "/aai/v11/network/logical-links/logical-link/logicallink-987654321-21-LB1113",
+ "relationship-data": [
+ {
+ "relationship-key": "logical-link.link-name",
+ "relationship-value": "logicallink-987654321-21-LB1113"
+ }
+ ]
+ }
+ ]
+ },
+ "l3-interface-ipv4-address-list": [
+ {
+ "l3-interface-ipv4-address": "112.121.144.16",
+ "l3-interface-ipv4-prefix-length": 59,
+ "vlan-id-inner": 917,
+ "vlan-id-outer": 519,
+ "is-floating": true,
+ "resource-version": "1504038598353",
+ "neutron-network-id": "HX6m54p1akX",
+ "neutron-subnet-id": "nbmX5okGg"
+ }
+ ],
+ "l3-interface-ipv6-address-list": [
+ {
+ "l3-interface-ipv6-address": "2001:232E:2333:2322:122C:CDD:2AE3:3E4",
+ "l3-interface-ipv6-prefix-length": 76,
+ "vlan-id-inner": 27,
+ "vlan-id-outer": 710,
+ "is-floating": true,
+ "resource-version": "1504038598364",
+ "neutron-network-id": "xBR0OOToQ",
+ "neutron-subnet-id": "4E0gZLH"
+ }
+ ]
+ },
+ "extra-properties":{
+
+ }
+ }
+ ]
+ }
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/resources/aai_get_node_template_instances.json b/vid-app-common/src/main/resources/aai_get_node_template_instances.json
new file mode 100644
index 000000000..97c452aa3
--- /dev/null
+++ b/vid-app-common/src/main/resources/aai_get_node_template_instances.json
@@ -0,0 +1,101 @@
+{"results": [
+ {
+ "id": "1976357096",
+ "node-type": "generic-vnf",
+ "url": "/aai/v11/network/generic-vnfs/generic-vnf/VNF-1-9887-jc689q",
+ "properties": {
+ "vnf-id": "0846287b-65bf-45a6-88f6-6a1af4149fac",
+ "vnf-name": "vnf9887-1jc689q",
+ "vnf-name2": "notused",
+ "vnf-type": "VRR",
+ "service-id": "VRRaaS",
+ "regional-resource-zone": "notusedforMobility",
+ "prov-status": "PREPROV",
+ "operational-status": "",
+ "license-key": "novalue",
+ "equipment-role": "VRR",
+ "orchestration-status": "Created",
+ "heat-stack-id": "1234",
+ "mso-catalog-key": "msokey",
+ "ipv4-oam-address": "135.60.77.25",
+ "ipv4-loopback0-address": "12.60.77.25",
+ "nm-lan-v6-address": "2001:1890:1F8:2075::1:4",
+ "management-v6-address": "2001:1890:1F8:2075::1:5",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "resource-version": "1505337418309",
+ "model-invariant-id": "96129eb9-f0de-4e05-8af2-73146473f766",
+ "model-version-id": "5761e0a7-c6df-4d8a-9ebd-b8f445054dec",
+ "widget-model-id": "78789",
+ "widget-model-version": "7",
+ "nf-function": "nf-function in ASDC",
+ "nf-role": "nf-role in ASDC",
+ "nf-naming-code": "code in ASDC",
+ "selflink": "pathToController"
+ },
+ "related-to": [
+ {
+ "id": "1689710648",
+ "node-type": "service-instance",
+ "url": "/aai/v11/business/customers/customer/customer-9887-jc689q/service-subscriptions/service-subscription/VRR/service-instances/service-instance/SI-9887-jc689q"
+ },
+ {
+ "id": "1362120784",
+ "node-type": "vserver",
+ "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner-id-9887-jc689q/cloudRegion-id-9887-jc689q/tenants/tenant/tenant-id-9887-jc689q/vservers/vserver/vserver-id-2-9887-jc689q"
+ },
+ {
+ "id": "2017317104",
+ "node-type": "vserver",
+ "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner-id-9887-jc689q/cloudRegion-id-9887-jc689q/tenants/tenant/tenant-id-9887-jc689q/vservers/vserver/vserver-id-1-9887-jc689q"
+ }
+ ]
+ },
+ {
+ "id": "2362269792",
+ "node-type": "generic-vnf",
+ "url": "/aai/v11/network/generic-vnfs/generic-vnf/VNF-2-9887-jc689q",
+ "properties": {
+ "vnf-id": "c187e9fe-40c3-4862-b73e-84ff056205f6",
+ "vnf-name": "vnf9887-2jc689q",
+ "vnf-name2": "notused",
+ "vnf-type": "VRR",
+ "service-id": "VRRaaS",
+ "regional-resource-zone": "notusedforMobility",
+ "prov-status": "PREPROV",
+ "operational-status": "",
+ "license-key": "novalue",
+ "equipment-role": "VRR",
+ "orchestration-status": "Created",
+ "heat-stack-id": "1234",
+ "mso-catalog-key": "msokey",
+ "ipv4-oam-address": "135.60.77.25",
+ "ipv4-loopback0-address": "12.60.77.25",
+ "nm-lan-v6-address": "2001:1890:1F8:2075::1:4",
+ "management-v6-address": "2001:1890:1F8:2075::1:5",
+ "in-maint": false,
+ "is-closed-loop-disabled": false,
+ "resource-version": "1505337418754",
+ "model-invariant-id": "96129eb9-f0de-4e05-8af2-73146473f766",
+ "model-version-id": "5761e0a7-c6df-4d8a-9ebd-b8f445054dec",
+ "widget-model-id": "78789",
+ "widget-model-version": "7",
+ "nf-function": "nf-function in ASDC",
+ "nf-role": "nf-role in ASDC",
+ "nf-naming-code": "code in ASDC",
+ "selflink": "pathToController"
+ },
+ "related-to": [
+ {
+ "id": "1689710648",
+ "node-type": "service-instance",
+ "url": "/aai/v11/business/customers/customer/customer-9887-jc689q/service-subscriptions/service-subscription/VRR/service-instances/service-instance/SI-9887-jc689q"
+ },
+ {
+ "id": "1689706552",
+ "node-type": "vserver",
+ "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/cloudOwner-id-9887-jc689q/cloudRegion-id-9887-jc689q/tenants/tenant/tenant-id-9887-jc689q/vservers/vserver/vserver-id-3-9887-jc689q"
+ }
+ ]
+ }
+]} \ No newline at end of file
diff --git a/vid-app-common/src/main/resources/adiod.zip b/vid-app-common/src/main/resources/adiod.zip
new file mode 100644
index 000000000..415fa4833
--- /dev/null
+++ b/vid-app-common/src/main/resources/adiod.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/csar317927061915233480.zip b/vid-app-common/src/main/resources/csar317927061915233480.zip
new file mode 100644
index 000000000..36ac9f9bc
--- /dev/null
+++ b/vid-app-common/src/main/resources/csar317927061915233480.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/generateRoleScript.sh b/vid-app-common/src/main/resources/generateRoleScript.sh
new file mode 100644
index 000000000..cf73b7412
--- /dev/null
+++ b/vid-app-common/src/main/resources/generateRoleScript.sh
@@ -0,0 +1,3 @@
+firstRun=${1-false}
+url=http://127.0.0.1:8080/vid/generateRoleScript/$firstRun
+wget -O roles.sql $url \ No newline at end of file
diff --git a/vid-app-common/src/main/resources/json/mso/modelInfo b/vid-app-common/src/main/resources/json/mso/modelInfo
index dcb31128d..d368e3532 100755
--- a/vid-app-common/src/main/resources/json/mso/modelInfo
+++ b/vid-app-common/src/main/resources/json/mso/modelInfo
@@ -33,6 +33,7 @@
"description": "short description of the entity being operated on",
"type": "string",
"enum": [
+ "pnf",
"network",
"service",
"vfModule",
diff --git a/vid-app-common/src/main/resources/json/mso/requestStatus b/vid-app-common/src/main/resources/json/mso/requestStatus
index 11b285636..75b72151b 100755
--- a/vid-app-common/src/main/resources/json/mso/requestStatus
+++ b/vid-app-common/src/main/resources/json/mso/requestStatus
@@ -8,15 +8,6 @@
},
"requestState": {
"description": "short description of the instantiation state",
- "enum": [
- "COMPLETE",
- "FAILED",
- "IN_PROGRESS",
- "PENDING",
- "UNLOCKED",
- "COMPLETED",
- ""
- ],
"type": "string"
},
"statusMessage": {
diff --git a/vid-app-common/src/main/resources/owning-entity-properties.JSON b/vid-app-common/src/main/resources/owning-entity-properties.JSON
new file mode 100644
index 000000000..a86c28c6c
--- /dev/null
+++ b/vid-app-common/src/main/resources/owning-entity-properties.JSON
@@ -0,0 +1,17 @@
+{
+ "owningEntityProperties" : {
+ "platform": {
+ "Platform-name": "Platform-name"
+ },
+ "project": {
+ "Project-name": "Project-name"
+ },
+ "lineOfBusiness": {
+ "Line-of-business-name": "Line-of-business-name"
+ },
+ "owningEntity": {
+ "Owning-entity-id": "Owning-entity-name"
+ }
+ }
+}
+
diff --git a/vid-app-common/src/main/resources/pnf.csar b/vid-app-common/src/main/resources/pnf.zip
index eb4248469..eb4248469 100644
--- a/vid-app-common/src/main/resources/pnf.csar
+++ b/vid-app-common/src/main/resources/pnf.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/scripts/category_parameter.sh b/vid-app-common/src/main/resources/scripts/category_parameter.sh
new file mode 100644
index 000000000..0ff1c73c3
--- /dev/null
+++ b/vid-app-common/src/main/resources/scripts/category_parameter.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+usage() { echo -e "Usage: $0 [-o <ADD|GET>] [-p <FILE_PATH>] [-c category_name] [-f FAMILY]" 1>&2; exit 1; }
+while getopts ":o:p:c:f:" opt; do
+ case ${opt} in
+ o)
+ OPERATION=${OPTARG}
+ ;;
+ p)
+ FILE=${OPTARG}
+ ;;
+ c)
+ CATEGORY=${OPTARG}
+ ;;
+ f)
+ FAMILY=${OPTARG}
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+if [ -z "${FILE}" ] || [ -z "${OPERATION}" ]; then
+ usage
+fi
+if [ ${OPERATION} != 'ADD' ] && [ ${OPERATION} != 'GET' ]; then
+ usage
+fi
+if [ ${OPERATION} = 'ADD' ]; then
+ if [ -z "${CATEGORY}" ] ; then
+ usage
+ fi
+ OPERATION='POST'
+fi
+if [ ${OPERATION} = 'GET' ]; then
+ if [ -z "${FAMILY}" ] ; then
+ usage
+ fi
+fi
+URL="http://127.0.0.1:8080/vid/maintenance/category_parameter"
+if [ ${OPERATION} = 'GET' ]; then
+ FULLURL="${URL}?familyName=${FAMILY}"
+ echo "Sending request: ${FULLURL}"
+ echo -e "------------------------\nwget output:"
+ wget -nv -O "${FILE}" "${FULLURL}"
+ RC=$?
+ echo "---------------------------"
+ if [ $RC -eq 0 ]; then
+ echo "Result saved to ${FILE}"
+ else
+ echo "Failed to get category parameters list"
+ fi
+else
+ BODY=$(cat ${FILE} | awk ' BEGIN { ; print " {\"options\" : [ "} { gsub(/ /, "", $0) ; printf "%s\"%s\"",separator,$1 ;separator = ", ";} END { printf " ]} "}')
+ FULLURL="${URL}/${CATEGORY}"
+ echo "Sending request: ${FULLURL} ${OPERATION} ${BODY}"
+ echo -e "------------------------\nwget output:"
+ wget --method="${OPERATION}" --body-data="${BODY}" --header=Content-Type:application/json --content-on-error -nv -O - "${FULLURL}"
+ RC=$?
+ echo "---------------------------"
+ if [ $RC -ne 0 ]; then
+ echo "Failed to ADD options to category ${CATEGORY}"
+ fi
+fi
diff --git a/vid-app-common/src/main/resources/scripts/update_category_option_name.sh b/vid-app-common/src/main/resources/scripts/update_category_option_name.sh
new file mode 100644
index 000000000..5ff505800
--- /dev/null
+++ b/vid-app-common/src/main/resources/scripts/update_category_option_name.sh
@@ -0,0 +1,34 @@
+#!/bin/bash
+usage() { echo -e "Usage: $0 [-c category_name] [-i option_id] [-n option_updated_name]" 1>&2; exit 1; }
+while getopts ":c:i:n:" opt; do
+ case ${opt} in
+ i)
+ ID=${OPTARG}
+ ;;
+ n)
+ NAME=${OPTARG}
+ ;;
+ c)
+ CATEGORY=${OPTARG}
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+if [ -z "${ID}" ] || [ -z "${NAME}" ] || [ -z "${CATEGORY}" ]; then
+ usage
+fi
+URL="http://127.0.0.1:8080/vid/maintenance/category_parameter/"
+OPERATION="PUT"
+FULLURL="${URL}${CATEGORY}"
+BODY="{\"id\":\"${ID}\",\"name\":\"${NAME}\"}"
+echo "Sending request: ${FULLURL} ${OPERATION} ${BODY}"
+echo -e "------------------------\nwget output:"
+wget --method="${OPERATION}" --body-data="${BODY}" --header=Content-Type:application/json --content-on-error -nv -O - "${FULLURL}"
+RC=$?
+echo "---------------------------"
+if [ $RC -ne 0 ]; then
+ echo "Failed to update option name ${NAME} for option id ${ID} of category ${CATEGORY}"
+fi \ No newline at end of file
diff --git a/vid-app-common/src/main/resources/scripts/vnf_wf.sh b/vid-app-common/src/main/resources/scripts/vnf_wf.sh
new file mode 100644
index 000000000..69cb595b5
--- /dev/null
+++ b/vid-app-common/src/main/resources/scripts/vnf_wf.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+usage() { echo -e "Usage: $0 [-o <ADD|DELETE|GET>] [-p <FILE_PATH>]\nCSV File Format: VNF_UUID,VNF_invariantUUID,workflowName" 1>&2; exit 1; }
+while getopts ":o:p:" opt; do
+ case ${opt} in
+ o)
+ OPERATION=${OPTARG}
+ ;;
+ p)
+ FILE=${OPTARG}
+ ;;
+ *)
+ usage
+ ;;
+ esac
+done
+shift $((OPTIND-1))
+if [ -z "${FILE}" ] || [ -z "${OPERATION}" ]; then
+ usage
+fi
+if [ ${OPERATION} != 'ADD' ] && [ ${OPERATION} != 'DELETE' ] && [ ${OPERATION} != 'GET' ]; then
+ usage
+fi
+if [ ${OPERATION} = 'ADD' ]; then
+ OPERATION='POST'
+fi
+URL="http://127.0.0.1:8080/vid/change-management/vnf_workflow_relation"
+if [ ${OPERATION} = 'GET' ]; then
+ echo "Sending request for get all vnf_workflow_relation"
+ echo -e "------------------------\nwget output:"
+ wget -nv -O "${FILE}" "${URL}"
+ RC=$?
+ echo "---------------------------"
+ if [ $RC -eq 0 ]; then
+ echo "Result saved to ${FILE}"
+ else
+ echo "Failed to get vnf to workflows relations"
+ fi
+else
+ BODY=$(cat ${FILE} | awk ' BEGIN { FS=","; print " {\"workflowsDetails\" : [ "} { gsub(/ /, "", $1) ; gsub(/ /, "", $2) ; gsub(/^[ \t]+/,"",$3); gsub(/[ \t]+$/,"",$3); printf "%s{\"vnfDetails\":{\"UUID\":\"%s\",\"invariantUUID\":\"%s\"},\"workflowName\":\"%s\"}",separator,$1,$2,$3 ;separator = ", ";} END { printf " ]} "}')
+ echo "Sending request: ${OPERATION} ${BODY}"
+ echo -e "------------------------\nwget output:"
+ wget --method="${OPERATION}" --body-data="${BODY}" --header=Content-Type:application/json --content-on-error -nv -O - "${URL}"
+ RC=$?
+ echo "---------------------------"
+ if [ $RC -ne 0 ]; then
+ echo "Failed to ADD/DELETE vnf to workflows relations"
+ fi
+fi
+
diff --git a/vid-app-common/src/main/resources/sdcservices.json b/vid-app-common/src/main/resources/sdcservices.json
index 81a08d931..1d936f630 100644
--- a/vid-app-common/src/main/resources/sdcservices.json
+++ b/vid-app-common/src/main/resources/sdcservices.json
@@ -4,7 +4,7 @@
"uuid": "48a52540-8772-4368-9cdb-1f124ea5c931",
"invariantUUID": "f430728a-4530-42be-a577-1206b9484cef",
"name": "4-27_vMME_Service",
- "version": "0.1",
+ "version": "1.0",
"toscaModelURL": "./service-vf-csar.zip",
"category": "Mobility",
"lifecycleState": "CERTIFIED",
@@ -15,10 +15,10 @@
"resources": null
},
{
- "uuid": "68101369-6f08-4e99-9a28-fa6327d344f3",
+ "uuid": "cb49608f-5a24-4789-b0f7-2595473cb997",
"invariantUUID": "0311f998-9268-4fd6-bbba-afff15087b72",
"name": "4-27_vMME_Service",
- "version": "0.1",
+ "version": "1.0",
"toscaModelURL": "./service-vl-csar.zip",
"category": "Mobility",
"lifecycleState": "CERTIFIED",
@@ -32,8 +32,78 @@
"uuid": "73e1322a-8a9a-49dc-9558-b0c5c5770e4a",
"invariantUUID": "f430728a-4530-42be-a577-1206b9484cef",
"name": "4-27_vMME_Service",
- "version": "0.1",
- "toscaModelURL": "./pnf.csar",
+ "version": "1.0",
+ "toscaModelURL": "./pnf.zip",
+ "category": "Mobility",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "rg276b",
+ "lastUpdaterFullName": null,
+ "distributionStatus": "DISTRIBUTED",
+ "artifacts": null,
+ "resources": null
+ },
+ {
+ "uuid": "240376de-870e-48df-915a-31f140eedd2c",
+ "invariantUUID": "709d1be4-9a3f-4a29-8c4d-a20465e808a3",
+ "name": "Demo Service",
+ "version": "1.0",
+ "toscaModelURL": "./service-DemoService1-csar.csar",
+ "category": "Mobility",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "rg276b",
+ "lastUpdaterFullName": null,
+ "distributionStatus": "DISTRIBUTED",
+ "artifacts": null,
+ "resources": null
+ },
+ {
+ "uuid": "32671332-a7ee-4df6-9609-db50ce5eaee7",
+ "invariantUUID": "598e3f9e-3244-4d8f-a8e0-0e5d7a29eda9",
+ "name": "ADIOD vMX vPE_BV Service 488",
+ "version": "1.0",
+ "toscaModelURL": "./adiod.zip",
+ "category": "Mobility",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "rg276b",
+ "lastUpdaterFullName": null,
+ "distributionStatus": "DISTRIBUTED",
+ "artifacts": null,
+ "resources": null
+ },
+ {
+ "uuid": "55a48870-d99e-41a8-a3b4-a8d748333139",
+ "invariantUUID": "3d89efc0-19ca-4df7-9818-028e1fc6f708",
+ "name": "AMP PH SVC",
+ "version": "1.0",
+ "toscaModelURL": "./service-AmpPhSvc-csar.zip",
+ "category": "Mobility",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "rg276b",
+ "lastUpdaterFullName": null,
+ "distributionStatus": "DISTRIBUTED",
+ "artifacts": null,
+ "resources": null
+ },
+ {
+ "uuid": "2f80c596-27e5-4ca9-b5bb-e03a7fd4c0fd",
+ "invariantUUID": "e49fbd11-e60c-4a8e-b4bf-30fbe8f4fcc0",
+ "name": "action-data",
+ "version": "1.0",
+ "toscaModelURL": "./2f80c596.zip",
+ "category": "Mobility",
+ "lifecycleState": "CERTIFIED",
+ "lastUpdaterUserId": "rg276b",
+ "lastUpdaterFullName": null,
+ "distributionStatus": "DISTRIBUTED",
+ "artifacts": null,
+ "resources": null
+ },
+ {
+ "uuid": "ee6d61be-4841-4f98-8f23-5de9da846ca7",
+ "invariantUUID": "b7d923c9-6175-41f1-91ba-4565c4953408",
+ "name": "Multiple pProbes",
+ "version": "1.0",
+ "toscaModelURL": "./service-Servicecontainermultiplepprobes-csar.csar",
"category": "Mobility",
"lifecycleState": "CERTIFIED",
"lastUpdaterUserId": "rg276b",
diff --git a/vid-app-common/src/main/resources/service-AmpPhSvc-csar.zip b/vid-app-common/src/main/resources/service-AmpPhSvc-csar.zip
new file mode 100644
index 000000000..6d5002c6c
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-AmpPhSvc-csar.zip
Binary files differ
diff --git a/vid-app-common/src/main/resources/service-David-csar.csar b/vid-app-common/src/main/resources/service-David-csar.csar
new file mode 100644
index 000000000..fcf1c647b
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-David-csar.csar
Binary files differ
diff --git a/vid-app-common/src/main/resources/service-DemoService1-csar.csar b/vid-app-common/src/main/resources/service-DemoService1-csar.csar
new file mode 100644
index 000000000..0e34dc5ce
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-DemoService1-csar.csar
Binary files differ
diff --git a/vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csar b/vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csar
new file mode 100644
index 000000000..81691fe1f
--- /dev/null
+++ b/vid-app-common/src/main/resources/service-Servicecontainermultiplepprobes-csar.csar
Binary files differ
diff --git a/vid-app-common/src/main/resources/test.csv b/vid-app-common/src/main/resources/test.csv
new file mode 100644
index 000000000..a0b09b77c
--- /dev/null
+++ b/vid-app-common/src/main/resources/test.csv
@@ -0,0 +1,5 @@
+ee6d61be-4841-4f98-8f23-5de9da846ca7,95c75a48-6f86-498f-b1a6-e9179a83d9c7,Update
+ee6d61be-4841-4f98-8f23-5de9da846ca7,95c75a48-6f86-498f-b1a6-e9179a83d9c7, VNF In Place Software Update
+418f32e5-484a-4073-8fa9-fab7d497459f,709d1be4-9a3f-4a29-8c4d-a20465e808a3, VNF In Place Software Update
+fa06db34-f8e3-42d9-8e51-a76816eb0f0d,0ebfb706-a846-4715-b0d0-fe0be09458d7, VNF In Place Software Update
+fa06db34-f8e3-42d9-8e51-a76816eb0f0d, 87447b67-29e3-4244-8038-990a8c70259a,Replace \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js b/vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js
new file mode 100644
index 000000000..4bfe94221
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/external/upload-file/ng-file-upload.min.js
@@ -0,0 +1,3 @@
+/*! 12.2.13 */
+!window.XMLHttpRequest||window.FileAPI&&FileAPI.shouldLoad||(window.XMLHttpRequest.prototype.setRequestHeader=function(a){return function(b,c){if("__setXHR_"===b){var d=c(this);d instanceof Function&&d(this)}else a.apply(this,arguments)}}(window.XMLHttpRequest.prototype.setRequestHeader));var ngFileUpload=angular.module("ngFileUpload",[]);ngFileUpload.version="12.2.13",ngFileUpload.service("UploadBase",["$http","$q","$timeout",function(a,b,c){function d(d){function e(a){j.notify&&j.notify(a),k.progressFunc&&c(function(){k.progressFunc(a)})}function h(a){return null!=d._start&&g?{loaded:a.loaded+d._start,total:d._file&&d._file.size||a.total,type:a.type,config:d,lengthComputable:!0,target:a.target}:a}function i(){a(d).then(function(a){if(g&&d._chunkSize&&!d._finished&&d._file){var b=d._file&&d._file.size||0;e({loaded:Math.min(d._end,b),total:b,config:d,type:"progress"}),f.upload(d,!0)}else d._finished&&delete d._finished,j.resolve(a)},function(a){j.reject(a)},function(a){j.notify(a)})}d.method=d.method||"POST",d.headers=d.headers||{};var j=d._deferred=d._deferred||b.defer(),k=j.promise;return d.disableProgress||(d.headers.__setXHR_=function(){return function(a){a&&a.upload&&a.upload.addEventListener&&(d.__XHR=a,d.xhrFn&&d.xhrFn(a),a.upload.addEventListener("progress",function(a){a.config=d,e(h(a))},!1),a.upload.addEventListener("load",function(a){a.lengthComputable&&(a.config=d,e(h(a)))},!1))}}),g?d._chunkSize&&d._end&&!d._finished?(d._start=d._end,d._end+=d._chunkSize,i()):d.resumeSizeUrl?a.get(d.resumeSizeUrl).then(function(a){d._start=d.resumeSizeResponseReader?d.resumeSizeResponseReader(a.data):parseInt((null==a.data.size?a.data:a.data.size).toString()),d._chunkSize&&(d._end=d._start+d._chunkSize),i()},function(a){throw a}):d.resumeSize?d.resumeSize().then(function(a){d._start=a,d._chunkSize&&(d._end=d._start+d._chunkSize),i()},function(a){throw a}):(d._chunkSize&&(d._start=0,d._end=d._start+d._chunkSize),i()):i(),k.success=function(a){return k.then(function(b){a(b.data,b.status,b.headers,d)}),k},k.error=function(a){return k.then(null,function(b){a(b.data,b.status,b.headers,d)}),k},k.progress=function(a){return k.progressFunc=a,k.then(null,null,function(b){a(b)}),k},k.abort=k.pause=function(){return d.__XHR&&c(function(){d.__XHR.abort()}),k},k.xhr=function(a){return d.xhrFn=function(b){return function(){b&&b.apply(k,arguments),a.apply(k,arguments)}}(d.xhrFn),k},f.promisesCount++,k["finally"]&&k["finally"]instanceof Function&&k["finally"](function(){f.promisesCount--}),k}function e(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c]);return b}var f=this;f.promisesCount=0,this.isResumeSupported=function(){return window.Blob&&window.Blob.prototype.slice};var g=this.isResumeSupported();this.isUploadInProgress=function(){return f.promisesCount>0},this.rename=function(a,b){return a.ngfName=b,a},this.jsonBlob=function(a){null==a||angular.isString(a)||(a=JSON.stringify(a));var b=new window.Blob([a],{type:"application/json"});return b._ngfBlob=!0,b},this.json=function(a){return angular.toJson(a)},this.isFile=function(a){return null!=a&&(a instanceof window.Blob||a.flashId&&a.name&&a.size)},this.upload=function(a,b){function c(b,c){if(b._ngfBlob)return b;if(a._file=a._file||b,null!=a._start&&g){a._end&&a._end>=b.size&&(a._finished=!0,a._end=b.size);var d=b.slice(a._start,a._end||b.size);return d.name=b.name,d.ngfName=b.ngfName,a._chunkSize&&(c.append("_chunkSize",a._chunkSize),c.append("_currentChunkSize",a._end-a._start),c.append("_chunkNumber",Math.floor(a._start/a._chunkSize)),c.append("_totalSize",a._file.size)),d}return b}function h(b,d,e){if(void 0!==d)if(angular.isDate(d)&&(d=d.toISOString()),angular.isString(d))b.append(e,d);else if(f.isFile(d)){var g=c(d,b),i=e.split(",");i[1]&&(g.ngfName=i[1].replace(/^\s+|\s+$/g,""),e=i[0]),a._fileKey=a._fileKey||e,b.append(e,g,g.ngfName||g.name)}else if(angular.isObject(d)){if(d.$$ngfCircularDetection)throw"ngFileUpload: Circular reference in config.data. Make sure specified data for Upload.upload() has no circular reference: "+e;d.$$ngfCircularDetection=!0;try{for(var j in d)if(d.hasOwnProperty(j)&&"$$ngfCircularDetection"!==j){var k=null==a.objectKey?"[i]":a.objectKey;d.length&&parseInt(j)>-1&&(k=null==a.arrayKey?k:a.arrayKey),h(b,d[j],e+k.replace(/[ik]/g,j))}}finally{delete d.$$ngfCircularDetection}}else b.append(e,d)}function i(){a._chunkSize=f.translateScalars(a.resumeChunkSize),a._chunkSize=a._chunkSize?parseInt(a._chunkSize.toString()):null,a.headers=a.headers||{},a.headers["Content-Type"]=void 0,a.transformRequest=a.transformRequest?angular.isArray(a.transformRequest)?a.transformRequest:[a.transformRequest]:[],a.transformRequest.push(function(b){var c,d=new window.FormData;b=b||a.fields||{},a.file&&(b.file=a.file);for(c in b)if(b.hasOwnProperty(c)){var e=b[c];a.formDataAppender?a.formDataAppender(d,c,e):h(d,e,c)}return d})}return b||(a=e(a)),a._isDigested||(a._isDigested=!0,i()),d(a)},this.http=function(b){return b=e(b),b.transformRequest=b.transformRequest||function(b){return window.ArrayBuffer&&b instanceof window.ArrayBuffer||b instanceof window.Blob?b:a.defaults.transformRequest[0].apply(this,arguments)},b._chunkSize=f.translateScalars(b.resumeChunkSize),b._chunkSize=b._chunkSize?parseInt(b._chunkSize.toString()):null,d(b)},this.translateScalars=function(a){if(angular.isString(a)){if(a.search(/kb/i)===a.length-2)return parseFloat(1024*a.substring(0,a.length-2));if(a.search(/mb/i)===a.length-2)return parseFloat(1048576*a.substring(0,a.length-2));if(a.search(/gb/i)===a.length-2)return parseFloat(1073741824*a.substring(0,a.length-2));if(a.search(/b/i)===a.length-1)return parseFloat(a.substring(0,a.length-1));if(a.search(/s/i)===a.length-1)return parseFloat(a.substring(0,a.length-1));if(a.search(/m/i)===a.length-1)return parseFloat(60*a.substring(0,a.length-1));if(a.search(/h/i)===a.length-1)return parseFloat(3600*a.substring(0,a.length-1))}return a},this.urlToBlob=function(c){var d=b.defer();return a({url:c,method:"get",responseType:"arraybuffer"}).then(function(a){var b=new Uint8Array(a.data),e=a.headers("content-type")||"image/WebP",f=new window.Blob([b],{type:e}),g=c.match(/.*\/(.+?)(\?.*)?$/);g.length>1&&(f.name=g[1]),d.resolve(f)},function(a){d.reject(a)}),d.promise},this.setDefaults=function(a){this.defaults=a||{}},this.defaults={},this.version=ngFileUpload.version}]),ngFileUpload.service("Upload",["$parse","$timeout","$compile","$q","UploadExif",function(a,b,c,d,e){function f(a,b,c){var e=[i.emptyPromise()];return angular.forEach(a,function(d,f){0===d.type.indexOf("image/jpeg")&&i.attrGetter("ngfFixOrientation",b,c,{$file:d})&&e.push(i.happyPromise(i.applyExifRotation(d),d).then(function(b){a.splice(f,1,b)}))}),d.all(e)}function g(a,b,c,e){var f=i.attrGetter("ngfResize",b,c);if(!f||!i.isResizeSupported()||!a.length)return i.emptyPromise();if(f instanceof Function){var g=d.defer();return f(a).then(function(d){h(d,a,b,c,e).then(function(a){g.resolve(a)},function(a){g.reject(a)})},function(a){g.reject(a)})}return h(f,a,b,c,e)}function h(a,b,c,e,f){function g(d,g){if(0===d.type.indexOf("image")){if(a.pattern&&!i.validatePattern(d,a.pattern))return;a.resizeIf=function(a,b){return i.attrGetter("ngfResizeIf",c,e,{$width:a,$height:b,$file:d})};var j=i.resize(d,a);h.push(j),j.then(function(a){b.splice(g,1,a)},function(a){d.$error="resize",(d.$errorMessages=d.$errorMessages||{}).resize=!0,d.$errorParam=(a?(a.message?a.message:a)+": ":"")+(d&&d.name),f.$ngfValidations.push({name:"resize",valid:!1}),i.applyModelValidation(f,b)})}}for(var h=[i.emptyPromise()],j=0;j<b.length;j++)g(b[j],j);return d.all(h)}var i=e;return i.getAttrWithDefaults=function(a,b){if(null!=a[b])return a[b];var c=i.defaults[b];return null==c?c:angular.isString(c)?c:JSON.stringify(c)},i.attrGetter=function(b,c,d,e){var f=this.getAttrWithDefaults(c,b);if(!d)return f;try{return e?a(f)(d,e):a(f)(d)}catch(g){if(b.search(/min|max|pattern/i))return f;throw g}},i.shouldUpdateOn=function(a,b,c){var d=i.attrGetter("ngfModelOptions",b,c);return d&&d.updateOn?d.updateOn.split(" ").indexOf(a)>-1:!0},i.emptyPromise=function(){var a=d.defer(),c=arguments;return b(function(){a.resolve.apply(a,c)}),a.promise},i.rejectPromise=function(){var a=d.defer(),c=arguments;return b(function(){a.reject.apply(a,c)}),a.promise},i.happyPromise=function(a,c){var e=d.defer();return a.then(function(a){e.resolve(a)},function(a){b(function(){throw a}),e.resolve(c)}),e.promise},i.updateModel=function(c,d,e,h,j,k,l){function m(f,g,j,l,m){d.$$ngfPrevValidFiles=f,d.$$ngfPrevInvalidFiles=g;var n=f&&f.length?f[0]:null,o=g&&g.length?g[0]:null;c&&(i.applyModelValidation(c,f),c.$setViewValue(m?n:f)),h&&a(h)(e,{$files:f,$file:n,$newFiles:j,$duplicateFiles:l,$invalidFiles:g,$invalidFile:o,$event:k});var p=i.attrGetter("ngfModelInvalid",d);p&&b(function(){a(p).assign(e,m?o:g)}),b(function(){})}function n(){function a(a,b){return a.name===b.name&&(a.$ngfOrigSize||a.size)===(b.$ngfOrigSize||b.size)&&a.type===b.type}function b(b){var c;for(c=0;c<r.length;c++)if(a(b,r[c]))return!0;for(c=0;c<s.length;c++)if(a(b,s[c]))return!0;return!1}if(j){q=[],t=[];for(var c=0;c<j.length;c++)b(j[c])?t.push(j[c]):q.push(j[c])}}function o(a){return angular.isArray(a)?a:[a]}function p(){function a(){b(function(){m(w?r.concat(v):v,w?s.concat(u):u,j,t,x)},z&&z.debounce?z.debounce.change||z.debounce:0)}var f=y?q:v;g(f,d,e,c).then(function(){y?i.validate(q,w?r.length:0,c,d,e).then(function(b){v=b.validsFiles,u=b.invalidsFiles,a()}):a()},function(){for(var b=0;b<f.length;b++){var c=f[b];if("resize"===c.$error){var d=v.indexOf(c);d>-1&&(v.splice(d,1),u.push(c)),a()}}})}var q,r,s,t=[],u=[],v=[];r=d.$$ngfPrevValidFiles||[],s=d.$$ngfPrevInvalidFiles||[],c&&c.$modelValue&&(r=o(c.$modelValue));var w=i.attrGetter("ngfKeep",d,e);q=(j||[]).slice(0),("distinct"===w||i.attrGetter("ngfKeepDistinct",d,e)===!0)&&n(d,e);var x=!w&&!i.attrGetter("ngfMultiple",d,e)&&!i.attrGetter("multiple",d);if(!w||q.length){i.attrGetter("ngfBeforeModelChange",d,e,{$files:j,$file:j&&j.length?j[0]:null,$newFiles:q,$duplicateFiles:t,$event:k});var y=i.attrGetter("ngfValidateAfterResize",d,e),z=i.attrGetter("ngfModelOptions",d,e);i.validate(q,w?r.length:0,c,d,e).then(function(a){l?m(q,[],j,t,x):(z&&z.allowInvalid||y?v=q:(v=a.validFiles,u=a.invalidFiles),i.attrGetter("ngfFixOrientation",d,e)&&i.isExifSupported()?f(v,d,e).then(function(){p()}):p())})}},i}]),ngFileUpload.directive("ngfSelect",["$parse","$timeout","$compile","Upload",function(a,b,c,d){function e(a){var b=a.match(/Android[^\d]*(\d+)\.(\d+)/);if(b&&b.length>2){var c=d.defaults.androidFixMinorVersion||4;return parseInt(b[1])<4||parseInt(b[1])===c&&parseInt(b[2])<c}return-1===a.indexOf("Chrome")&&/.*Windows.*Safari.*/.test(a)}function f(a,b,c,d,f,h,i,j){function k(){return"input"===b[0].tagName.toLowerCase()&&c.type&&"file"===c.type.toLowerCase()}function l(){return t("ngfChange")||t("ngfSelect")}function m(b){if(j.shouldUpdateOn("change",c,a)){var e=b.__files_||b.target&&b.target.files,f=[];if(!e)return;for(var g=0;g<e.length;g++)f.push(e[g]);j.updateModel(d,c,a,l(),f.length?f:null,b)}}function n(a,d){function e(b){a.attr("id","ngf-"+b),d.attr("id","ngf-label-"+b)}for(var f=0;f<b[0].attributes.length;f++){var g=b[0].attributes[f];"type"!==g.name&&"class"!==g.name&&"style"!==g.name&&("id"===g.name?(e(g.value),u.push(c.$observe("id",e))):a.attr(g.name,g.value||"required"!==g.name&&"multiple"!==g.name?g.value:g.name))}}function o(){if(k())return b;var a=angular.element('<input type="file">'),c=angular.element("<label>upload</label>");return c.css("visibility","hidden").css("position","absolute").css("overflow","hidden").css("width","0px").css("height","0px").css("border","none").css("margin","0px").css("padding","0px").attr("tabindex","-1"),n(a,c),g.push({el:b,ref:c}),document.body.appendChild(c.append(a)[0]),a}function p(c){if(b.attr("disabled"))return!1;if(!t("ngfSelectDisabled",a)){var d=q(c);if(null!=d)return d;r(c);try{k()||document.body.contains(x[0])||(g.push({el:b,ref:x.parent()}),document.body.appendChild(x.parent()[0]),x.bind("change",m))}catch(f){}return e(navigator.userAgent)?setTimeout(function(){x[0].click()},0):x[0].click(),!1}}function q(a){var b=a.changedTouches||a.originalEvent&&a.originalEvent.changedTouches;if(b){if("touchstart"===a.type)return w=b[0].clientX,v=b[0].clientY,!0;if("touchend"===a.type){var c=b[0].clientX,d=b[0].clientY;if(Math.abs(c-w)>20||Math.abs(d-v)>20)return a.stopPropagation(),a.preventDefault(),!1}return!0}}function r(b){j.shouldUpdateOn("click",c,a)&&x.val()&&(x.val(null),j.updateModel(d,c,a,l(),null,b,!0))}function s(a){if(x&&!x.attr("__ngf_ie10_Fix_")){if(!x[0].parentNode)return void(x=null);a.preventDefault(),a.stopPropagation(),x.unbind("click");var b=x.clone();return x.replaceWith(b),x=b,x.attr("__ngf_ie10_Fix_","true"),x.bind("change",m),x.bind("click",s),x[0].click(),!1}x.removeAttr("__ngf_ie10_Fix_")}var t=function(a,b){return j.attrGetter(a,c,b)};j.registerModelChangeValidator(d,c,a);var u=[];t("ngfMultiple")&&u.push(a.$watch(t("ngfMultiple"),function(){x.attr("multiple",t("ngfMultiple",a))})),t("ngfCapture")&&u.push(a.$watch(t("ngfCapture"),function(){x.attr("capture",t("ngfCapture",a))})),t("ngfAccept")&&u.push(a.$watch(t("ngfAccept"),function(){x.attr("accept",t("ngfAccept",a))})),u.push(c.$observe("accept",function(){x.attr("accept",t("accept"))}));var v=0,w=0,x=b;k()||(x=o()),x.bind("change",m),k()?b.bind("click",r):b.bind("click touchstart touchend",p),-1!==navigator.appVersion.indexOf("MSIE 10")&&x.bind("click",s),d&&d.$formatters.push(function(a){return(null==a||0===a.length)&&x.val()&&x.val(null),a}),a.$on("$destroy",function(){k()||x.parent().remove(),angular.forEach(u,function(a){a()})}),h(function(){for(var a=0;a<g.length;a++){var b=g[a];document.body.contains(b.el[0])||(g.splice(a,1),b.ref.remove())}}),window.FileAPI&&window.FileAPI.ngfFixIE&&window.FileAPI.ngfFixIE(b,x,m)}var g=[];return{restrict:"AEC",require:"?ngModel",link:function(e,g,h,i){f(e,g,h,i,a,b,c,d)}}}]),function(){function a(a){return"img"===a.tagName.toLowerCase()?"image":"audio"===a.tagName.toLowerCase()?"audio":"video"===a.tagName.toLowerCase()?"video":/./}function b(b,c,d,e,f,g,h,i){function j(a){var g=b.attrGetter("ngfNoObjectUrl",f,d);b.dataUrl(a,g)["finally"](function(){c(function(){var b=(g?a.$ngfDataUrl:a.$ngfBlobUrl)||a.$ngfDataUrl;i?e.css("background-image","url('"+(b||"")+"')"):e.attr("src",b),b?e.removeClass("ng-hide"):e.addClass("ng-hide")})})}c(function(){var c=d.$watch(f[g],function(c){var k=h;if("ngfThumbnail"===g&&(k||(k={width:e[0].naturalWidth||e[0].clientWidth,height:e[0].naturalHeight||e[0].clientHeight}),0===k.width&&window.getComputedStyle)){var l=getComputedStyle(e[0]);l.width&&l.width.indexOf("px")>-1&&l.height&&l.height.indexOf("px")>-1&&(k={width:parseInt(l.width.slice(0,-2)),height:parseInt(l.height.slice(0,-2))})}return angular.isString(c)?(e.removeClass("ng-hide"),i?e.css("background-image","url('"+c+"')"):e.attr("src",c)):void(!c||!c.type||0!==c.type.search(a(e[0]))||i&&0!==c.type.indexOf("image")?e.addClass("ng-hide"):k&&b.isResizeSupported()?(k.resizeIf=function(a,e){return b.attrGetter("ngfResizeIf",f,d,{$width:a,$height:e,$file:c})},b.resize(c,k).then(function(a){j(a)},function(a){throw a})):j(c))});d.$on("$destroy",function(){c()})})}ngFileUpload.service("UploadDataUrl",["UploadBase","$timeout","$q",function(a,b,c){var d=a;return d.base64DataUrl=function(a){if(angular.isArray(a)){var b=c.defer(),e=0;return angular.forEach(a,function(c){d.dataUrl(c,!0)["finally"](function(){if(e++,e===a.length){var c=[];angular.forEach(a,function(a){c.push(a.$ngfDataUrl)}),b.resolve(c,a)}})}),b.promise}return d.dataUrl(a,!0)},d.dataUrl=function(a,e){if(!a)return d.emptyPromise(a,a);if(e&&null!=a.$ngfDataUrl||!e&&null!=a.$ngfBlobUrl)return d.emptyPromise(e?a.$ngfDataUrl:a.$ngfBlobUrl,a);var f=e?a.$$ngfDataUrlPromise:a.$$ngfBlobUrlPromise;if(f)return f;var g=c.defer();return b(function(){if(window.FileReader&&a&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 8")||a.size<2e4)&&(!window.FileAPI||-1===navigator.userAgent.indexOf("MSIE 9")||a.size<4e6)){var c=window.URL||window.webkitURL;if(c&&c.createObjectURL&&!e){var f;try{f=c.createObjectURL(a)}catch(h){return void b(function(){a.$ngfBlobUrl="",g.reject()})}b(function(){if(a.$ngfBlobUrl=f,f){g.resolve(f,a),d.blobUrls=d.blobUrls||[],d.blobUrlsTotalSize=d.blobUrlsTotalSize||0,d.blobUrls.push({url:f,size:a.size}),d.blobUrlsTotalSize+=a.size||0;for(var b=d.defaults.blobUrlsMaxMemory||268435456,e=d.defaults.blobUrlsMaxQueueSize||200;(d.blobUrlsTotalSize>b||d.blobUrls.length>e)&&d.blobUrls.length>1;){var h=d.blobUrls.splice(0,1)[0];c.revokeObjectURL(h.url),d.blobUrlsTotalSize-=h.size}}})}else{var i=new FileReader;i.onload=function(c){b(function(){a.$ngfDataUrl=c.target.result,g.resolve(c.target.result,a),b(function(){delete a.$ngfDataUrl},1e3)})},i.onerror=function(){b(function(){a.$ngfDataUrl="",g.reject()})},i.readAsDataURL(a)}}else b(function(){a[e?"$ngfDataUrl":"$ngfBlobUrl"]="",g.reject()})}),f=e?a.$$ngfDataUrlPromise=g.promise:a.$$ngfBlobUrlPromise=g.promise,f["finally"](function(){delete a[e?"$$ngfDataUrlPromise":"$$ngfBlobUrlPromise"]}),f},d}]),ngFileUpload.directive("ngfSrc",["Upload","$timeout",function(a,c){return{restrict:"AE",link:function(d,e,f){b(a,c,d,e,f,"ngfSrc",a.attrGetter("ngfResize",f,d),!1)}}}]),ngFileUpload.directive("ngfBackground",["Upload","$timeout",function(a,c){return{restrict:"AE",link:function(d,e,f){b(a,c,d,e,f,"ngfBackground",a.attrGetter("ngfResize",f,d),!0)}}}]),ngFileUpload.directive("ngfThumbnail",["Upload","$timeout",function(a,c){return{restrict:"AE",link:function(d,e,f){var g=a.attrGetter("ngfSize",f,d);b(a,c,d,e,f,"ngfThumbnail",g,a.attrGetter("ngfAsBackground",f,d))}}}]),ngFileUpload.config(["$compileProvider",function(a){a.imgSrcSanitizationWhitelist&&a.imgSrcSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/),a.aHrefSanitizationWhitelist&&a.aHrefSanitizationWhitelist(/^\s*(https?|ftp|mailto|tel|webcal|local|file|data|blob):/)}]),ngFileUpload.filter("ngfDataUrl",["UploadDataUrl","$sce",function(a,b){return function(c,d,e){if(angular.isString(c))return b.trustAsResourceUrl(c);var f=c&&((d?c.$ngfDataUrl:c.$ngfBlobUrl)||c.$ngfDataUrl);return c&&!f?(!c.$ngfDataUrlFilterInProgress&&angular.isObject(c)&&(c.$ngfDataUrlFilterInProgress=!0,a.dataUrl(c,d)),""):(c&&delete c.$ngfDataUrlFilterInProgress,(c&&f?e?b.trustAsResourceUrl(f):f:c)||"")}}])}(),ngFileUpload.service("UploadValidate",["UploadDataUrl","$q","$timeout",function(a,b,c){function d(a){var b="",c=[];if(a.length>2&&"/"===a[0]&&"/"===a[a.length-1])b=a.substring(1,a.length-1);else{var e=a.split(",");if(e.length>1)for(var f=0;f<e.length;f++){var g=d(e[f]);g.regexp?(b+="("+g.regexp+")",f<e.length-1&&(b+="|")):c=c.concat(g.excludes)}else 0===a.indexOf("!")?c.push("^((?!"+d(a.substring(1)).regexp+").)*$"):(0===a.indexOf(".")&&(a="*"+a),b="^"+a.replace(new RegExp("[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\-]","g"),"\\$&")+"$",b=b.replace(/\\\*/g,".*").replace(/\\\?/g,"."))}return{regexp:b,excludes:c}}function e(a,b){null==b||a.$dirty||(a.$setDirty?a.$setDirty():a.$dirty=!0)}var f=a;return f.validatePattern=function(a,b){if(!b)return!0;var c=d(b),e=!0;if(c.regexp&&c.regexp.length){var f=new RegExp(c.regexp,"i");e=null!=a.type&&f.test(a.type)||null!=a.name&&f.test(a.name)}for(var g=c.excludes.length;g--;){var h=new RegExp(c.excludes[g],"i");e=e&&(null==a.type||h.test(a.type))&&(null==a.name||h.test(a.name))}return e},f.ratioToFloat=function(a){var b=a.toString(),c=b.search(/[x:]/i);return b=c>-1?parseFloat(b.substring(0,c))/parseFloat(b.substring(c+1)):parseFloat(b)},f.registerModelChangeValidator=function(a,b,c){a&&a.$formatters.push(function(d){if(a.$dirty){var e=d;d&&!angular.isArray(d)&&(e=[d]),f.validate(e,0,a,b,c).then(function(){f.applyModelValidation(a,e)})}return d})},f.applyModelValidation=function(a,b){e(a,b),angular.forEach(a.$ngfValidations,function(b){a.$setValidity(b.name,b.valid)})},f.getValidationAttr=function(a,b,c,d,e){var g="ngf"+c[0].toUpperCase()+c.substr(1),h=f.attrGetter(g,a,b,{$file:e});if(null==h&&(h=f.attrGetter("ngfValidate",a,b,{$file:e}))){var i=(d||c).split(".");h=h[i[0]],i.length>1&&(h=h&&h[i[1]])}return h},f.validate=function(a,c,d,e,g){function h(b,c,h){if(a){for(var i=a.length,j=null;i--;){var n=a[i];if(n){var o=f.getValidationAttr(e,g,b,c,n);null!=o&&(h(n,o,i)||(-1===k.indexOf(b)?(n.$error=b,(n.$errorMessages=n.$errorMessages||{})[b]=!0,n.$errorParam=o,-1===m.indexOf(n)&&m.push(n),l||a.splice(i,1),j=!1):a.splice(i,1)))}}null!==j&&d.$ngfValidations.push({name:b,valid:j})}}function i(c,h,i,n,o){function p(b,d,e){function f(f){if(f())if(-1===k.indexOf(c)){if(d.$error=c,(d.$errorMessages=d.$errorMessages||{})[c]=!0,d.$errorParam=e,-1===m.indexOf(d)&&m.push(d),!l){var g=a.indexOf(d);g>-1&&a.splice(g,1)}b.resolve(!1)}else{var h=a.indexOf(d);h>-1&&a.splice(h,1),b.resolve(!0)}else b.resolve(!0)}null!=e?n(d,e).then(function(a){f(function(){return!o(a,e)})},function(){f(function(){return j("ngfValidateForce",{$file:d})})}):b.resolve(!0)}var q=[f.emptyPromise(!0)];a&&(a=void 0===a.length?[a]:a,angular.forEach(a,function(a){var d=b.defer();return q.push(d.promise),!i||null!=a.type&&0===a.type.search(i)?void("dimensions"===c&&null!=f.attrGetter("ngfDimensions",e)?f.imageDimensions(a).then(function(b){p(d,a,j("ngfDimensions",{$file:a,$width:b.width,$height:b.height}))},function(){d.resolve(!1)}):"duration"===c&&null!=f.attrGetter("ngfDuration",e)?f.mediaDuration(a).then(function(b){p(d,a,j("ngfDuration",{$file:a,$duration:b}))},function(){d.resolve(!1)}):p(d,a,f.getValidationAttr(e,g,c,h,a))):void d.resolve(!0)}));var r=b.defer();return b.all(q).then(function(a){for(var b=!0,e=0;e<a.length;e++)if(!a[e]){b=!1;break}d.$ngfValidations.push({name:c,valid:b}),r.resolve(b)}),r.promise}d=d||{},d.$ngfValidations=d.$ngfValidations||[],angular.forEach(d.$ngfValidations,function(a){a.valid=!0});var j=function(a,b){return f.attrGetter(a,e,g,b)},k=(f.attrGetter("ngfIgnoreInvalid",e,g)||"").split(" "),l=f.attrGetter("ngfRunAllValidations",e,g);if(null==a||0===a.length)return f.emptyPromise({validFiles:a,invalidFiles:[]});a=void 0===a.length?[a]:a.slice(0);var m=[];h("pattern",null,f.validatePattern),h("minSize","size.min",function(a,b){return a.size+.1>=f.translateScalars(b)}),h("maxSize","size.max",function(a,b){return a.size-.1<=f.translateScalars(b)});var n=0;if(h("maxTotalSize",null,function(b,c){return n+=b.size,n>f.translateScalars(c)?(a.splice(0,a.length),!1):!0}),h("validateFn",null,function(a,b){return b===!0||null===b||""===b}),!a.length)return f.emptyPromise({validFiles:[],invalidFiles:m});var o=b.defer(),p=[];return p.push(i("maxHeight","height.max",/image/,this.imageDimensions,function(a,b){return a.height<=b})),p.push(i("minHeight","height.min",/image/,this.imageDimensions,function(a,b){return a.height>=b})),p.push(i("maxWidth","width.max",/image/,this.imageDimensions,function(a,b){return a.width<=b})),p.push(i("minWidth","width.min",/image/,this.imageDimensions,function(a,b){return a.width>=b})),p.push(i("dimensions",null,/image/,function(a,b){return f.emptyPromise(b)},function(a){return a})),p.push(i("ratio",null,/image/,this.imageDimensions,function(a,b){for(var c=b.toString().split(","),d=!1,e=0;e<c.length;e++)Math.abs(a.width/a.height-f.ratioToFloat(c[e]))<.01&&(d=!0);return d})),p.push(i("maxRatio","ratio.max",/image/,this.imageDimensions,function(a,b){return a.width/a.height-f.ratioToFloat(b)<1e-4})),p.push(i("minRatio","ratio.min",/image/,this.imageDimensions,function(a,b){return a.width/a.height-f.ratioToFloat(b)>-1e-4})),p.push(i("maxDuration","duration.max",/audio|video/,this.mediaDuration,function(a,b){return a<=f.translateScalars(b)})),p.push(i("minDuration","duration.min",/audio|video/,this.mediaDuration,function(a,b){return a>=f.translateScalars(b)})),p.push(i("duration",null,/audio|video/,function(a,b){return f.emptyPromise(b)},function(a){return a})),p.push(i("validateAsyncFn",null,null,function(a,b){return b},function(a){return a===!0||null===a||""===a})),b.all(p).then(function(){if(l)for(var b=0;b<a.length;b++){var d=a[b];d.$error&&a.splice(b--,1)}l=!1,h("maxFiles",null,function(a,b,d){return b>c+d}),o.resolve({validFiles:a,invalidFiles:m})}),o.promise},f.imageDimensions=function(a){if(a.$ngfWidth&&a.$ngfHeight){var d=b.defer();return c(function(){d.resolve({width:a.$ngfWidth,height:a.$ngfHeight})}),d.promise}if(a.$ngfDimensionPromise)return a.$ngfDimensionPromise;var e=b.defer();return c(function(){return 0!==a.type.indexOf("image")?void e.reject("not image"):void f.dataUrl(a).then(function(b){function d(){var b=h[0].naturalWidth||h[0].clientWidth,c=h[0].naturalHeight||h[0].clientHeight;h.remove(),a.$ngfWidth=b,a.$ngfHeight=c,e.resolve({width:b,height:c})}function f(){h.remove(),e.reject("load error")}function g(){c(function(){h[0].parentNode&&(h[0].clientWidth?d():i++>10?f():g())},1e3)}var h=angular.element("<img>").attr("src",b).css("visibility","hidden").css("position","fixed").css("max-width","none !important").css("max-height","none !important");h.on("load",d),h.on("error",f);var i=0;g(),angular.element(document.getElementsByTagName("body")[0]).append(h)},function(){e.reject("load error")})}),a.$ngfDimensionPromise=e.promise,a.$ngfDimensionPromise["finally"](function(){delete a.$ngfDimensionPromise}),a.$ngfDimensionPromise},f.mediaDuration=function(a){if(a.$ngfDuration){var d=b.defer();return c(function(){d.resolve(a.$ngfDuration)}),d.promise}if(a.$ngfDurationPromise)return a.$ngfDurationPromise;var e=b.defer();return c(function(){return 0!==a.type.indexOf("audio")&&0!==a.type.indexOf("video")?void e.reject("not media"):void f.dataUrl(a).then(function(b){function d(){var b=h[0].duration;a.$ngfDuration=b,h.remove(),e.resolve(b)}function f(){h.remove(),e.reject("load error")}function g(){c(function(){h[0].parentNode&&(h[0].duration?d():i>10?f():g())},1e3)}var h=angular.element(0===a.type.indexOf("audio")?"<audio>":"<video>").attr("src",b).css("visibility","none").css("position","fixed");h.on("loadedmetadata",d),h.on("error",f);var i=0;g(),angular.element(document.body).append(h)},function(){e.reject("load error")})}),a.$ngfDurationPromise=e.promise,a.$ngfDurationPromise["finally"](function(){delete a.$ngfDurationPromise}),a.$ngfDurationPromise},f}]),ngFileUpload.service("UploadResize",["UploadValidate","$q",function(a,b){var c=a,d=function(a,b,c,d,e){var f=e?Math.max(c/a,d/b):Math.min(c/a,d/b);return{width:a*f,height:b*f,marginX:a*f-c,marginY:b*f-d}},e=function(a,e,f,g,h,i,j,k){var l=b.defer(),m=document.createElement("canvas"),n=document.createElement("img");return n.setAttribute("style","visibility:hidden;position:fixed;z-index:-100000"),document.body.appendChild(n),n.onload=function(){var a=n.width,b=n.height;if(n.parentNode.removeChild(n),null!=k&&k(a,b)===!1)return void l.reject("resizeIf");try{if(i){var o=c.ratioToFloat(i),p=a/b;o>p?(e=a,f=e/o):(f=b,e=f*o)}e||(e=a),f||(f=b);var q=d(a,b,e,f,j);m.width=Math.min(q.width,e),m.height=Math.min(q.height,f);var r=m.getContext("2d");r.drawImage(n,Math.min(0,-q.marginX/2),Math.min(0,-q.marginY/2),q.width,q.height),l.resolve(m.toDataURL(h||"image/WebP",g||.934))}catch(s){l.reject(s)}},n.onerror=function(){n.parentNode.removeChild(n),l.reject()},n.src=a,l.promise};return c.dataUrltoBlob=function(a,b,c){for(var d=a.split(","),e=d[0].match(/:(.*?);/)[1],f=atob(d[1]),g=f.length,h=new Uint8Array(g);g--;)h[g]=f.charCodeAt(g);var i=new window.Blob([h],{type:e});return i.name=b,i.$ngfOrigSize=c,i},c.isResizeSupported=function(){var a=document.createElement("canvas");return window.atob&&a.getContext&&a.getContext("2d")&&window.Blob},c.isResizeSupported()&&Object.defineProperty(window.Blob.prototype,"name",{get:function(){return this.$ngfName},set:function(a){this.$ngfName=a},configurable:!0}),c.resize=function(a,d){if(0!==a.type.indexOf("image"))return c.emptyPromise(a);var f=b.defer();return c.dataUrl(a,!0).then(function(b){e(b,d.width,d.height,d.quality,d.type||a.type,d.ratio,d.centerCrop,d.resizeIf).then(function(e){if("image/jpeg"===a.type&&d.restoreExif!==!1)try{e=c.restoreExif(b,e)}catch(g){setTimeout(function(){throw g},1)}try{var h=c.dataUrltoBlob(e,a.name,a.size);f.resolve(h)}catch(g){f.reject(g)}},function(b){"resizeIf"===b&&f.resolve(a),f.reject(b)})},function(a){f.reject(a)}),f.promise},c}]),function(){function a(a,c,d,e,f,g,h,i,j,k){function l(){return c.attr("disabled")||s("ngfDropDisabled",a)}function m(b,c,d){if(b){var e;try{e=b&&b.getData&&b.getData("text/html")}catch(f){}q(b.items,b.files,s("ngfAllowDir",a)!==!1,s("multiple")||s("ngfMultiple",a)).then(function(a){a.length?n(a,c):o(d,e).then(function(a){n(a,c)})})}}function n(b,c){i.updateModel(e,d,a,s("ngfChange")||s("ngfDrop"),b,c)}function o(b,c){if(!i.shouldUpdateOn(b,d,a)||"string"!=typeof c)return i.rejectPromise([]);var e=[];c.replace(/<(img src|img [^>]* src) *=\"([^\"]*)\"/gi,function(a,b,c){e.push(c)});var f=[],g=[];if(e.length){angular.forEach(e,function(a){f.push(i.urlToBlob(a).then(function(a){g.push(a)}))});var h=k.defer();return k.all(f).then(function(){h.resolve(g)},function(a){h.reject(a)}),h.promise}return i.emptyPromise()}function p(a,b,c,d){var e=s("ngfDragOverClass",a,{$event:c}),f="dragover";if(angular.isString(e))f=e;else if(e&&(e.delay&&(w=e.delay),e.accept||e.reject)){var g=c.dataTransfer.items;if(null!=g&&g.length)for(var h=e.pattern||s("ngfPattern",a,{$event:c}),j=g.length;j--;){if(!i.validatePattern(g[j],h)){f=e.reject;break}f=e.accept}else f=e.accept}d(f)}function q(b,c,e,f){function g(a,b){var c=k.defer();if(null!=a)if(a.isDirectory){var d=[i.emptyPromise()];if(m){var e={type:"directory"};e.name=e.path=(b||"")+a.name,n.push(e)}var f=a.createReader(),h=[],p=function(){f.readEntries(function(e){try{e.length?(h=h.concat(Array.prototype.slice.call(e||[],0)),p()):(angular.forEach(h.slice(0),function(c){n.length<=j&&l>=o&&d.push(g(c,(b?b:"")+a.name+"/"))}),k.all(d).then(function(){c.resolve()},function(a){c.reject(a)}))}catch(f){c.reject(f)}},function(a){c.reject(a)})};p()}else a.file(function(a){try{a.path=(b?b:"")+a.name,m&&(a=i.rename(a,a.path)),n.push(a),o+=a.size,c.resolve()}catch(d){c.reject(d)}},function(a){c.reject(a)});return c.promise}var j=i.getValidationAttr(d,a,"maxFiles");null==j&&(j=Number.MAX_VALUE);var l=i.getValidationAttr(d,a,"maxTotalSize");null==l&&(l=Number.MAX_VALUE);var m=s("ngfIncludeDir",a),n=[],o=0,p=[i.emptyPromise()];if(b&&b.length>0&&"file:"!==h.location.protocol)for(var q=0;q<b.length;q++){if(b[q].webkitGetAsEntry&&b[q].webkitGetAsEntry()&&b[q].webkitGetAsEntry().isDirectory){var r=b[q].webkitGetAsEntry();if(r.isDirectory&&!e)continue;null!=r&&p.push(g(r))}else{var t=b[q].getAsFile();null!=t&&(n.push(t),o+=t.size)}if(n.length>j||o>l||!f&&n.length>0)break}else if(null!=c)for(var u=0;u<c.length;u++){var v=c.item(u);if((v.type||v.size>0)&&(n.push(v),o+=v.size),n.length>j||o>l||!f&&n.length>0)break}var w=k.defer();return k.all(p).then(function(){if(f||m||!n.length)w.resolve(n);else{for(var a=0;n[a]&&"directory"===n[a].type;)a++;w.resolve([n[a]])}},function(a){w.reject(a)}),w.promise}var r=b(),s=function(a,b,c){return i.attrGetter(a,d,b,c)};if(s("dropAvailable")&&g(function(){a[s("dropAvailable")]?a[s("dropAvailable")].value=r:a[s("dropAvailable")]=r}),!r)return void(s("ngfHideOnDropNotAvailable",a)===!0&&c.css("display","none"));null==s("ngfSelect")&&i.registerModelChangeValidator(e,d,a);var t,u=null,v=f(s("ngfStopPropagation")),w=1;c[0].addEventListener("dragover",function(b){if(!l()&&i.shouldUpdateOn("drop",d,a)){if(b.preventDefault(),v(a)&&b.stopPropagation(),navigator.userAgent.indexOf("Chrome")>-1){var e=b.dataTransfer.effectAllowed;b.dataTransfer.dropEffect="move"===e||"linkMove"===e?"move":"copy"}g.cancel(u),t||(t="C",p(a,d,b,function(d){t=d,c.addClass(t),s("ngfDrag",a,{$isDragging:!0,$class:t,$event:b})}))}},!1),c[0].addEventListener("dragenter",function(b){!l()&&i.shouldUpdateOn("drop",d,a)&&(b.preventDefault(),v(a)&&b.stopPropagation())},!1),c[0].addEventListener("dragleave",function(b){!l()&&i.shouldUpdateOn("drop",d,a)&&(b.preventDefault(),
+v(a)&&b.stopPropagation(),u=g(function(){t&&c.removeClass(t),t=null,s("ngfDrag",a,{$isDragging:!1,$event:b})},w||100))},!1),c[0].addEventListener("drop",function(b){!l()&&i.shouldUpdateOn("drop",d,a)&&(b.preventDefault(),v(a)&&b.stopPropagation(),t&&c.removeClass(t),t=null,m(b.dataTransfer,b,"dropUrl"))},!1),c[0].addEventListener("paste",function(b){navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&s("ngfEnableFirefoxPaste",a)&&b.preventDefault(),!l()&&i.shouldUpdateOn("paste",d,a)&&m(b.clipboardData||b.originalEvent.clipboardData,b,"pasteUrl")},!1),navigator.userAgent.toLowerCase().indexOf("firefox")>-1&&s("ngfEnableFirefoxPaste",a)&&(c.attr("contenteditable",!0),c.on("keypress",function(a){a.metaKey||a.ctrlKey||a.preventDefault()}))}function b(){var a=document.createElement("div");return"draggable"in a&&"ondrop"in a&&!/Edge\/12./i.test(navigator.userAgent)}ngFileUpload.directive("ngfDrop",["$parse","$timeout","$window","Upload","$http","$q",function(b,c,d,e,f,g){return{restrict:"AEC",require:"?ngModel",link:function(h,i,j,k){a(h,i,j,k,b,c,d,e,f,g)}}}]),ngFileUpload.directive("ngfNoFileDrop",function(){return function(a,c){b()&&c.css("display","none")}}),ngFileUpload.directive("ngfDropAvailable",["$parse","$timeout","Upload",function(a,c,d){return function(e,f,g){if(b()){var h=a(d.attrGetter("ngfDropAvailable",g));c(function(){h(e),h.assign&&h.assign(e,!0)})}}}])}(),ngFileUpload.service("UploadExif",["UploadResize","$q",function(a,b){function c(a,b,c,d){switch(b){case 2:return a.transform(-1,0,0,1,c,0);case 3:return a.transform(-1,0,0,-1,c,d);case 4:return a.transform(1,0,0,-1,0,d);case 5:return a.transform(0,1,1,0,0,0);case 6:return a.transform(0,1,-1,0,d,0);case 7:return a.transform(0,-1,-1,0,d,c);case 8:return a.transform(0,-1,1,0,0,c)}}function d(a){for(var b="",c=new Uint8Array(a),d=c.byteLength,e=0;d>e;e++)b+=String.fromCharCode(c[e]);return window.btoa(b)}var e=a;return e.isExifSupported=function(){return window.FileReader&&(new FileReader).readAsArrayBuffer&&e.isResizeSupported()},e.readOrientation=function(a){var c=b.defer(),d=new FileReader,e=a.slice?a.slice(0,65536):a;return d.readAsArrayBuffer(e),d.onerror=function(a){return c.reject(a)},d.onload=function(a){var b={orientation:1},d=new DataView(this.result);if(65496!==d.getUint16(0,!1))return c.resolve(b);for(var e=d.byteLength,f=2;e>f;){var g=d.getUint16(f,!1);if(f+=2,65505===g){if(1165519206!==d.getUint32(f+=2,!1))return c.resolve(b);var h=18761===d.getUint16(f+=6,!1);f+=d.getUint32(f+4,h);var i=d.getUint16(f,h);f+=2;for(var j=0;i>j;j++)if(274===d.getUint16(f+12*j,h)){var k=d.getUint16(f+12*j+8,h);return k>=2&&8>=k&&(d.setUint16(f+12*j+8,1,h),b.fixedArrayBuffer=a.target.result),b.orientation=k,c.resolve(b)}}else{if(65280!==(65280&g))break;f+=d.getUint16(f,!1)}}return c.resolve(b)},c.promise},e.applyExifRotation=function(a){if(0!==a.type.indexOf("image/jpeg"))return e.emptyPromise(a);var f=b.defer();return e.readOrientation(a).then(function(b){return b.orientation<2||b.orientation>8?f.resolve(a):void e.dataUrl(a,!0).then(function(g){var h=document.createElement("canvas"),i=document.createElement("img");i.onload=function(){try{h.width=b.orientation>4?i.height:i.width,h.height=b.orientation>4?i.width:i.height;var g=h.getContext("2d");c(g,b.orientation,i.width,i.height),g.drawImage(i,0,0);var j=h.toDataURL(a.type||"image/WebP",.934);j=e.restoreExif(d(b.fixedArrayBuffer),j);var k=e.dataUrltoBlob(j,a.name);f.resolve(k)}catch(l){return f.reject(l)}},i.onerror=function(){f.reject()},i.src=g},function(a){f.reject(a)})},function(a){f.reject(a)}),f.promise},e.restoreExif=function(a,b){var c={};return c.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c.encode64=function(a){var b,c,d,e,f,g="",h="",i="",j=0;do b=a[j++],c=a[j++],h=a[j++],d=b>>2,e=(3&b)<<4|c>>4,f=(15&c)<<2|h>>6,i=63&h,isNaN(c)?f=i=64:isNaN(h)&&(i=64),g=g+this.KEY_STR.charAt(d)+this.KEY_STR.charAt(e)+this.KEY_STR.charAt(f)+this.KEY_STR.charAt(i),b=c=h="",d=e=f=i="";while(j<a.length);return g},c.restore=function(a,b){a.match("data:image/jpeg;base64,")&&(a=a.replace("data:image/jpeg;base64,",""));var c=this.decode64(a),d=this.slice2Segments(c),e=this.exifManipulation(b,d);return"data:image/jpeg;base64,"+this.encode64(e)},c.exifManipulation=function(a,b){var c=this.getExifArray(b),d=this.insertExif(a,c);return new Uint8Array(d)},c.getExifArray=function(a){for(var b,c=0;c<a.length;c++)if(b=a[c],255===b[0]&225===b[1])return b;return[]},c.insertExif=function(a,b){var c=a.replace("data:image/jpeg;base64,",""),d=this.decode64(c),e=d.indexOf(255,3),f=d.slice(0,e),g=d.slice(e),h=f;return h=h.concat(b),h=h.concat(g)},c.slice2Segments=function(a){for(var b=0,c=[];;){if(255===a[b]&218===a[b+1])break;if(255===a[b]&216===a[b+1])b+=2;else{var d=256*a[b+2]+a[b+3],e=b+d+2,f=a.slice(b,e);c.push(f),b=e}if(b>a.length)break}return c},c.decode64=function(a){var b,c,d,e,f,g="",h="",i=0,j=[],k=/[^A-Za-z0-9\+\/\=]/g;k.exec(a)&&console.log("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, NaNExpect errors in decoding."),a=a.replace(/[^A-Za-z0-9\+\/\=]/g,"");do d=this.KEY_STR.indexOf(a.charAt(i++)),e=this.KEY_STR.indexOf(a.charAt(i++)),f=this.KEY_STR.indexOf(a.charAt(i++)),h=this.KEY_STR.indexOf(a.charAt(i++)),b=d<<2|e>>4,c=(15&e)<<4|f>>2,g=(3&f)<<6|h,j.push(b),64!==f&&j.push(c),64!==h&&j.push(g),b=c=g="",d=e=f=h="";while(i<a.length);return j},c.restore(a,b)},e}]); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg b/vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg
new file mode 100644
index 000000000..7a774e123
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/icons/collapse-change-managment.svg
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="11px" height="3px" viewBox="0 0 11 3" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+ <title>Shape</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Change-Managment" transform="translate(-262.000000, -238.000000)" fill="#000000">
+ <g id="fab-copy" transform="translate(234.000000, 230.000000)">
+ <g id="add-copy" transform="translate(24.000000, 0.000000)">
+ <polygon id="Shape" points="10.2857143 8.71428571 8.71428571 8.71428571 4 8.71428571 4 10.2857143 8.71428571 10.2857143 10.2857143 10.2857143 15 10.2857143 15 8.71428571"></polygon>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg b/vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg
new file mode 100644
index 000000000..784714839
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/icons/expand-change-managment.svg
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="11px" height="11px" viewBox="0 0 11 11" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+ <title>add</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Change-Managment" transform="translate(-238.000000, -234.000000)">
+ <g id="fab-copy" transform="translate(234.000000, 230.000000)">
+ <g id="add">
+ <polygon id="bounds" points="19 0 0 0 0 19 19 19"></polygon>
+ <polygon id="Shape" fill="#5A5A5A" points="10.2857143 8.71428571 10.2857143 4 8.71428571 4 8.71428571 8.71428571 4 8.71428571 4 10.2857143 8.71428571 10.2857143 8.71428571 15 10.2857143 15 10.2857143 10.2857143 15 10.2857143 15 8.71428571"></polygon>
+ <polygon id="Shape" fill="#323943" points="10.2857143 8.71428571 10.2857143 4 8.71428571 4 8.71428571 8.71428571 4 8.71428571 4 10.2857143 8.71428571 10.2857143 8.71428571 15 10.2857143 15 10.2857143 10.2857143 15 10.2857143 15 8.71428571"></polygon>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg b/vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg
new file mode 100644
index 000000000..174a52eb8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/icons/refresh-change-managment.svg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="36px" height="33px" viewBox="0 0 36 33" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+ <title>Group 4</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Change-Managment" transform="translate(-1544.000000, -167.000000)" fill="#000000">
+ <g id="Group-4" transform="translate(1539.000000, 161.000000)">
+ <path d="M46.8694358,24.175791 C45.9994856,16.2172262 38.8825787,10.2854851 30.7284339,10.8556784 C24.5237875,11.2895496 19.2775923,15.4204556 17.3664133,21.1365857 L15.9019754,17.1882236 L14.5076414,17.7168536 L16.9050052,24.0765655 L22.9818228,21.7507351 L22.4483333,20.3733764 L18.7132068,21.8122285 C20.3736452,16.5462395 25.1585967,12.7241599 30.8313525,12.3274822 C38.1718767,11.8141827 44.5815219,17.1455631 45.3812187,24.3059932 L46.8694358,24.175791 Z" id="Combined-Shape" transform="translate(30.688539, 17.561891) scale(-1, 1) rotate(-51.000000) translate(-30.688539, -17.561891) "></path>
+ <path d="M31.668351,33.8536511 C30.7984008,25.8950863 23.6814939,19.9633451 15.5273491,20.5335385 C9.32270268,20.9674096 4.07650747,25.0983156 2.16532847,30.8144457 L0.700890606,26.8660837 L-0.69344337,27.3947136 L1.70392039,33.7544255 L7.78073796,31.4285952 L7.24724852,30.0512364 L3.512122,31.4900885 C5.17256042,26.2240996 9.95751192,22.4020199 15.6302677,22.0053422 C22.9707919,21.4920428 29.3804371,26.8234231 30.1801339,33.9838532 L31.668351,33.8536511 Z" id="Combined-Shape-Copy-2" transform="translate(15.487454, 27.239751) scale(-1, 1) rotate(-232.000000) translate(-15.487454, -27.239751) "></path>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/attach.svg b/vid-app-common/src/main/webapp/app/vid/images/attach.svg
new file mode 100644
index 000000000..ff28c9d32
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/attach.svg
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="14px" height="13px" viewBox="0 0 14 13" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
+ <title>Page 1 Copy 2</title>
+ <desc>Created with Sketch.</desc>
+ <defs>
+ <polygon id="path-1" points="0 0 14 0 14 13 0 13"></polygon>
+ </defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Change-Managment" transform="translate(-1696.000000, -181.000000)">
+ <g id="Page-1-Copy-2" transform="translate(1696.000000, 181.000000)">
+ <mask id="mask-2" fill="white">
+ <use xlink:href="#path-1"></use>
+ </mask>
+ <g id="Clip-2"></g>
+ <path d="M1.07738181,11.892665 C2.51371549,13.3691117 4.84984058,13.3691117 6.28634966,11.892665 L13.231757,4.75311054 C14.256081,3.70036026 14.256081,1.98141503 13.231757,0.928484448 C12.2076085,-0.124265836 10.5351892,-0.124265836 9.51104067,0.928484448 L2.56563328,8.06785861 C1.95366989,8.69691251 1.95366989,9.73361642 2.56563328,10.3628506 C3.17759667,10.9917242 4.18613479,10.9917242 4.79809819,10.3628506 L10.9992921,3.9882935 C11.2078403,3.78005124 11.2127514,3.4376685 11.0103422,3.22347646 C10.807933,3.00910412 10.4746769,3.00405582 10.2661288,3.21211779 C10.2624454,3.21590401 10.2589375,3.21969024 10.2552541,3.22347646 L4.05388475,9.59767299 C3.84130245,9.81619214 3.52242901,9.81619214 3.30984671,9.59767299 C3.09726442,9.37933413 3.09726442,9.0513751 3.30984671,8.83285595 L10.2550787,1.69348179 C10.8800215,1.05126625 11.8627762,1.05126625 12.487719,1.69348179 C13.1124865,2.33569732 13.1124865,3.34607797 12.487719,3.9882935 L5.54231162,11.1276677 C4.50518364,12.1937599 2.85854783,12.1937599 1.82141985,11.1276677 C0.78446726,10.0615755 0.78446726,8.36913378 1.82141985,7.30304157 L8.0227892,0.928484448 C8.23098655,0.720061888 8.2355469,0.377679153 8.03261149,0.163667407 C7.82985148,-0.050524636 7.4967708,-0.0550320443 7.28857345,0.153390516 C7.28524089,0.156816146 7.28190833,0.160241776 7.27857577,0.163667407 L1.07738181,6.53804423 C-0.35912727,8.01467119 -0.35912727,10.416038 1.07738181,11.892665" id="Fill-1" fill="#000000" mask="url(#mask-2)"></path>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg b/vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg
new file mode 100644
index 000000000..984311d1e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/elipsis_menu_icon.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Svg Vector Icons : http://www.onlinewebfonts.com/icon -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 1000 1000" enable-background="new 0 0 1000 1000" xml:space="preserve">
+<metadata> Svg Vector Icons : http://www.onlinewebfonts.com/icon </metadata>
+<g><g transform="translate(0.000000,511.000000) scale(0.100000,-0.100000)"><path d="M671,1004.4C51.1,734.4-96.2-88.1,388.7-573c687.4-693.5,1816.7-73.6,1638.8,896.1C1916.9,900,1223.4,1249.9,671,1004.4z"/><path d="M4599.1,1004.4C3979.2,734.4,3831.9-88.1,4316.8-573c687.4-693.5,1816.7-73.6,1638.8,896.1C5845,900,5151.5,1249.9,4599.1,1004.4z"/><path d="M8527.2,1004.4C7907.3,734.4,7760-88.1,8244.9-573c399-399,963.6-399,1362.5,0C10368.5,188.1,9515.4,1434,8527.2,1004.4z"/></g></g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/emptyData.svg b/vid-app-common/src/main/webapp/app/vid/images/emptyData.svg
new file mode 100644
index 000000000..9f639aadb
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/emptyData.svg
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="94px" height="88px" viewBox="0 0 94 88" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
+ <title>Page 1 Copy 15</title>
+ <desc>Created with Sketch.</desc>
+ <defs>
+ <polygon id="path-1" points="69 88 0 88 0 44.000352 0 0.000704 69 0.000704"></polygon>
+ </defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Test-Environments-NO-INFO" transform="translate(-1561.000000, -357.000000)">
+ <g id="Page-1-Copy-15" transform="translate(1561.000000, 357.000000)">
+ <g id="Group-3">
+ <mask id="mask-2" fill="white">
+ <use xlink:href="#path-1"></use>
+ </mask>
+ <g id="Clip-2"></g>
+ <path d="M65.4615385,84.480704 L3.53846154,84.480704 L3.53846154,8.800704 L12.3846154,8.800704 L12.3846154,12.320704 C12.3846154,13.292224 13.1754615,14.080704 14.1538462,14.080704 L54.8461538,14.080704 C55.8245385,14.080704 56.6153846,13.292224 56.6153846,12.320704 L56.6153846,8.800704 L65.4615385,8.800704 L65.4615385,84.480704 Z M15.9230769,3.520704 L53.0769231,3.520704 L53.0769231,5.280704 L53.0769231,8.800704 L53.0769231,10.560704 L15.9230769,10.560704 L15.9230769,8.800704 L15.9230769,5.280704 L15.9230769,3.520704 Z M67.2307692,5.280704 L56.6153846,5.280704 L56.6153846,1.760704 C56.6153846,0.787424 55.8245385,0.000704 54.8461538,0.000704 L14.1538462,0.000704 C13.1754615,0.000704 12.3846154,0.787424 12.3846154,1.760704 L12.3846154,5.280704 L1.76923077,5.280704 C0.790846154,5.280704 0,6.067424 0,7.040704 L0,86.240704 C0,87.213984 0.790846154,88.000704 1.76923077,88.000704 L67.2307692,88.000704 C68.2091538,88.000704 69,87.213984 69,86.240704 L69,7.040704 C69,6.067424 68.2091538,5.280704 67.2307692,5.280704 L67.2307692,5.280704 Z" id="Fill-1" fill="#191919" mask="url(#mask-2)"></path>
+ </g>
+ <path d="M90.6,67.2135388 L85.5,77.7785266 L80.4,67.2135388 L80.4,14.8041564 C80.4,11.8917415 82.6882,9.52166257 85.5,9.52166257 C88.3118,9.52166257 90.6,11.8917415 90.6,14.8041564 L90.6,67.2135388 Z M85.5,6 C80.8131,6 77,9.94954458 77,14.8041564 L77,67.6308559 C77,67.9037847 77.0612,68.1731919 77.1785,68.4179474 L83.8,82.1330623 L83.8,85.2391687 C83.8,86.2129084 84.5599,87 85.5,87 C86.4401,87 87.2,86.2129084 87.2,85.2391687 L87.2,82.1330623 L93.8215,68.4179474 C93.9388,68.1731919 94,67.9037847 94,67.6308559 L94,14.8041564 C94,9.94954458 90.1869,6 85.5,6 L85.5,6 Z" id="Fill-4" fill="#191919"></path>
+ <path d="M14,25 C15.104,25 16,25.896 16,27 C16,28.104 15.104,29 14,29 C12.896,29 12,28.104 12,27 C12,25.896 12.896,25 14,25" id="Fill-6" fill="#191919"></path>
+ <path d="M52.2631579,24.1818182 L22.7368421,24.1818182 C21.7763684,24.1818182 21,25.0351818 21,26.0909091 C21,27.1466364 21.7763684,28 22.7368421,28 L52.2631579,28 C53.2236316,28 54,27.1466364 54,26.0909091 C54,25.0351818 53.2236316,24.1818182 52.2631579,24.1818182 L52.2631579,7" id="Fill-8" fill="#191919"></path>
+ <path d="M14,38 C15.104,38 16,38.896 16,40 C16,41.104 15.104,42 14,42 C12.896,42 12,41.104 12,40 C12,38.896 12.896,38 14,38" id="Fill-10" fill="#191919"></path>
+ <path d="M52.2631579,38 L22.7368421,38 C21.7763684,38 21,38.894 21,40 C21,41.106 21.7763684,42 22.7368421,42 L52.2631579,42 C53.2236316,42 54,41.106 54,40 C54,38.894 53.2236316,38 52.2631579,38" id="Fill-12" fill="#191919"></path>
+ <path d="M14,52 C15.104,52 16,52.896 16,54 C16,55.104 15.104,56 14,56 C12.896,56 12,55.104 12,54 C12,52.896 12.896,52 14,52" id="Fill-14" fill="#191919"></path>
+ <path d="M52.2631579,52 L22.7368421,52 C21.7763684,52 21,52.894 21,54 C21,55.106 21.7763684,56 22.7368421,56 L52.2631579,56 C53.2236316,56 54,55.106 54,54 C54,52.894 53.2236316,52 52.2631579,52" id="Fill-16" fill="#191919"></path>
+ <path d="M14,67 C15.104,67 16,67.894 16,69 C16,70.104 15.104,71 14,71 C12.896,71 12,70.104 12,69 C12,67.894 12.896,67 14,67" id="Fill-18" fill="#191919"></path>
+ <path d="M52.2631579,67 L22.7368421,67 C21.7763684,67 21,67.894 21,69 C21,70.106 21.7763684,71 22.7368421,71 L52.2631579,71 C53.2236316,71 54,70.106 54,69 C54,67.894 53.2236316,67 52.2631579,67" id="Fill-20" fill="#191919"></path>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg b/vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg
new file mode 100644
index 000000000..6966076d1
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/icon_noconnection.svg
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="102px" height="83px" viewBox="0 0 102 83" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 47.1 (45422) - http://www.bohemiancoding.com/sketch -->
+ <title>Group 6</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Test-Environments-ERROR" transform="translate(-770.000000, -360.000000)" fill="#191919">
+ <g id="Page-1-Copy-15" transform="translate(770.000000, 360.000000)">
+ <g id="Group-6">
+ <path d="M84.3719292,80.6944444 L93.618168,80.6944444 L93.618168,71.4722222 L84.3719292,71.4722222 L84.3719292,80.6944444 Z M82.0603695,69.1666667 L82.0603695,74.9305556 L18.3768996,74.9305556 C9.59297277,74.9305556 2.3115597,67.7833333 2.3115597,58.9069444 L2.3115597,58.6763889 C2.3115597,49.8 9.59297277,42.6527778 18.3768996,42.6527778 L34.6733955,42.6527778 L34.6733955,40.3472222 L18.3768996,40.3472222 C8.32161493,40.3472222 0,48.5319444 0,58.6763889 L0,58.9069444 C0,69.0513889 8.32161493,77.2361111 18.3768996,77.2361111 L82.0603695,77.2361111 L82.0603695,83 L95.9297277,83 L95.9297277,80.6944444 L95.9297277,78.3888889 L95.9297277,73.7777778 L95.9297277,71.4722222 L95.9297277,69.1666667 L82.0603695,69.1666667 Z" id="Fill-3"></path>
+ <path d="M9.24623881,11.5277778 L18.4924776,11.5277778 L18.4924776,2.30555556 L9.24623881,2.30555556 L9.24623881,11.5277778 Z M83.5628833,5.76388889 L20.8040373,5.76388889 L20.8040373,4.61111111 L20.8040373,2.30555556 L20.8040373,0 L6.93467911,0 L6.93467911,5.76388889 L6.93467911,8.06944444 L6.93467911,13.8333333 L20.8040373,13.8333333 L20.8040373,11.5277778 L20.8040373,9.22222222 L20.8040373,8.06944444 L83.5628833,8.06944444 C92.4623881,8.06944444 99.6282232,15.2166667 99.6282232,24.0930556 L99.6282232,24.3236111 C99.6282232,33.2 92.4623881,40.3472222 83.5628833,40.3472222 L63.5678918,40.3472222 L63.5678918,42.6527778 L83.5628833,42.6527778 C93.733746,42.6527778 101.939783,34.4680556 101.939783,24.3236111 L101.939783,24.0930556 C101.939783,13.9486111 93.618168,5.76388889 83.5628833,5.76388889 L83.5628833,5.76388889 Z" id="Fill-5"></path>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/refresh.svg b/vid-app-common/src/main/webapp/app/vid/images/refresh.svg
new file mode 100644
index 000000000..4868d0614
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/refresh.svg
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="36px" height="32px" viewBox="0 0 36 32" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+ <title>Page 1</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="vid-" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="Artboard-Copy-2" transform="translate(-127.000000, -48.000000)" fill="#000000">
+ <g id="Page-1" transform="translate(127.000000, 47.000000)">
+ <g id="Group-3" transform="translate(9.000000, 0.338800)">
+ <path d="M0.7181,3.0151 C7.4501,-1.3179 16.5391,0.4801 21.2271,7.1761 C24.7951,12.2711 24.8861,18.9481 21.6461,24.0301 L25.6361,22.6831 L26.1031,24.1001 L19.6521,26.2391 L17.6351,20.0531 L19.0421,19.6001 L20.2741,23.4091 C23.3211,18.8051 23.2811,12.6811 20.0191,8.0221 C15.7991,1.9951 7.6211,0.3691 1.5531,4.2531 L0.7181,3.0151 Z" id="Fill-1"></path>
+ </g>
+ <g id="Group-6" transform="translate(0.000000, 6.338800)">
+ <path d="M25.0135,23.7841 C18.2065,27.9991 9.1505,26.0421 4.5795,19.2651 C1.1015,14.1091 1.1275,7.4321 4.4545,2.4071 L0.4415,3.6831 L-0.0005,2.2591 L6.4875,0.2331 L8.3955,6.4531 L6.9825,6.8811 L5.8165,3.0521 C2.6885,7.6021 2.6225,13.7261 5.8035,18.4401 C9.9175,24.5411 18.0655,26.3091 24.2005,22.5311 L25.0135,23.7841 Z" id="Fill-4"></path>
+ </g>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/images/search.svg b/vid-app-common/src/main/webapp/app/vid/images/search.svg
new file mode 100644
index 000000000..9dcc59086
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/search.svg
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 17 17" style="enable-background:new 0 0 17 17;" xml:space="preserve">
+<title>Fill 1</title>
+<desc>Created with Sketch.</desc>
+<g id="vid-">
+ <g id="Artboard-Copy-2" transform="translate(-197.000000, -61.000000)">
+ <path id="Fill-1" d="M204,73.9c-1.6,0-3-0.6-4.2-1.7c-1.1-1.1-1.7-2.6-1.7-4.2s0.6-3,1.7-4.2c1.1-1.1,2.6-1.7,4.2-1.7
+ c1.6,0,3,0.6,4.2,1.7c1.1,1.1,1.7,2.6,1.7,4.2s-0.6,3-1.7,4.2C207,73.3,205.6,73.9,204,73.9 M213.8,77.1l-4.5-4.5
+ c1.1-1.3,1.7-2.9,1.7-4.5c0-1.9-0.7-3.6-2-4.9c-1.3-1.3-3.1-2-4.9-2c-1.9,0-3.6,0.7-4.9,2c-1.3,1.3-2,3.1-2,4.9
+ c0,1.9,0.7,3.6,2,4.9c1.3,1.3,3.1,2,4.9,2c1.7,0,3.3-0.6,4.5-1.7l4.5,4.5c0.1,0.1,0.3,0.2,0.4,0.2c0.1,0,0.3-0.1,0.4-0.2
+ C214.1,77.6,214.1,77.3,213.8,77.1"/>
+ </g>
+</g>
+</svg>
diff --git a/vid-app-common/src/main/webapp/app/vid/images/sort_down.svg b/vid-app-common/src/main/webapp/app/vid/images/sort_down.svg
new file mode 100644
index 000000000..3dfaba158
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/sort_down.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 9 13" style="enable-background:new 0 0 9 13;" xml:space="preserve">
+<title>15 copy</title>
+<desc>Created with Sketch.</desc>
+<g id="vid-">
+ <g id="Artboard-Copy-2" transform="translate(-90.000000, -61.000000)">
+ <path id="_x31_5-copy" d="M93.6,61.9v8.2l-2.1-2.1c-0.2-0.2-0.4-0.3-0.6-0.3s-0.5,0.1-0.6,0.3c-0.4,0.4-0.4,0.9,0,1.3l3.6,3.6
+ c0.4,0.4,0.9,0.4,1.3,0l3.6-3.6c0.4-0.4,0.4-0.9,0-1.3c-0.4-0.4-0.9-0.4-1.3,0l-2.1,2.1v-8.2c0-0.5-0.4-0.9-0.9-0.9
+ C94,61,93.6,61.4,93.6,61.9z"/>
+ </g>
+</g>
+</svg>
diff --git a/vid-app-common/src/main/webapp/app/vid/images/sort_up.svg b/vid-app-common/src/main/webapp/app/vid/images/sort_up.svg
new file mode 100644
index 000000000..5f597dd41
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/sort_up.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 21.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 9 13" style="enable-background:new 0 0 9 13;" xml:space="preserve">
+<title>15</title>
+<desc>Created with Sketch.</desc>
+<g id="vid-">
+ <g id="Artboard-Copy-2" transform="translate(-53.000000, -61.000000)">
+ <path id="_x31_5" d="M58.4,72.3v-8.2l2.1,2.1c0.2,0.2,0.4,0.3,0.6,0.3c0.2,0,0.5-0.1,0.6-0.3c0.4-0.4,0.4-0.9,0-1.3l-3.6-3.6
+ c-0.4-0.4-0.9-0.4-1.3,0l-3.6,3.6c-0.4,0.4-0.4,0.9,0,1.3c0.4,0.4,0.9,0.4,1.3,0l2.1-2.1v8.2c0,0.5,0.4,0.9,0.9,0.9
+ C58,73.2,58.4,72.8,58.4,72.3z"/>
+ </g>
+</g>
+</svg>
diff --git a/vid-app-common/src/main/webapp/app/vid/images/sprite.png b/vid-app-common/src/main/webapp/app/vid/images/sprite.png
new file mode 100644
index 000000000..26079b7c5
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/sprite.png
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/images/v.svg b/vid-app-common/src/main/webapp/app/vid/images/v.svg
new file mode 100644
index 000000000..b6f77b91e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/images/v.svg
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<svg width="17px" height="17px" viewBox="0 0 17 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
+ <!-- Generator: Sketch 46.2 (44496) - http://www.bohemiancoding.com/sketch -->
+ <title>Combined Shape</title>
+ <desc>Created with Sketch.</desc>
+ <defs></defs>
+ <g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
+ <g id="**POPUPS-" transform="translate(-790.000000, -457.000000)" fill="#191919">
+ <g id="popup-medium-2" transform="translate(772.000000, 325.000000)">
+ <path d="M26.5,149 C21.8055796,149 18,145.19442 18,140.5 C18,135.80558 21.8055796,132 26.5,132 C31.1944204,132 35,135.80558 35,140.5 C35,145.19442 31.1944204,149 26.5,149 Z M23.8535534,140.549776 C23.6582912,140.354514 23.3417088,140.354514 23.1464466,140.549776 C22.9511845,140.745038 22.9511845,141.061621 23.1464466,141.256883 L25.7146903,143.825127 C25.9311409,144.041577 26.2895239,144.01447 26.4709545,143.767924 L30.8653572,137.796384 C31.0290275,137.573973 30.9814087,137.260993 30.7589977,137.097322 C30.5365867,136.933652 30.223606,136.981271 30.0599357,137.203682 L26.0103833,142.706606 L23.8535534,140.549776 Z" id="Combined-Shape"></path>
+ </g>
+ </g>
+ </g>
+</svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
index 534cee505..fa9ff1c75 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/componentConstants.js
@@ -28,7 +28,9 @@ appDS2
CLOUD_REGION_ID : "cloudRegionID",
COMPONENT_STATUS : "ComponentStatus",
CREATE_COMPONENT : "createComponent",
- DELETE_COMPONENT : "deleteComponent",
+ DELETE_RESUME_COMPONENT : "deleteResumeComponent",
+ DELETE:"Delete",
+ RESUME:"Resume",
ENTITY : "entity",
GET_COMPONENT_LIST : "getComponentList",
GET_SUBS : "getSubs",
@@ -43,8 +45,17 @@ appDS2
MODEL_VERSION_1 : "1",
MSO_CREATE_REQ : "createInstance",
MSO_DELETE_REQ : "deleteInstance",
+ MSO_CHANGE_CONFIG_STATUS_REQ: "changeConfigurationStatus",
+ MSO_CHANGE_PORT_STATUS_REQ: "changePortStatus",
+ MSO_CREATE_ENVIRONMENT: "createEnvironmentInstance",
+ MSO_DEACTIVATE_ENVIRONMENT: "deactivateEnvironmentInstance",
+ MSO_ACTIVATE_ENVIRONMENT: "activateEnvironmentInstance",
+ MSO_ACTIVATE_SERVICE_REQ: "activateServiceInstance",
+ MSO_DEACTIVATE_SERVICE_REQ: "deactivateServiceInstance",
NAME : "name",
NETWORK : "network",
+ CONFIGURATION : "configuration",
+ PORT: "port",
NETWORKS : "networks",
PRODUCT_NAME_TRINITY : "Trinity",
QUERY_SERVICE_INSTANCE : "queryServiceInstance",
@@ -69,8 +80,8 @@ appDS2
VNF_TYPE : "vnfType",
VOLUME_GROUP : "volumeGroup",
IS_PERMITTED: "is-permitted",
-
-
+ RESUME_STATUS: "PendingActivation",
+ PNF : "pnf",
// IDs
CIDR_MASK_1 : "255.255.255.000",
//COMPONENT_LIST_NAMED_QUERY_ID : "ed0a0f5b-cf79-4784-88b2-911cd726cd3d",
@@ -95,11 +106,12 @@ appDS2
SUBSCRIBER_NAME_GED12 : "General Electric Division 12",
VNF_INSTANCE_ID : "VNF_INSTANCE_ID_12345",
VPN_ID_1 : "1a2b3c4d5e6f",
-
+
// PATHS
- GET_WORKFLOW: "change-management/workflow?vnfs=@vnfs",
+ GET_WORKFLOW: "change-management/get_vnf_workflow_relation",
GET_MSO_WORKFLOWS: "change-management/mso",
GET_SCHEDULER_CHANGE_MANAGEMENTS: "change-management/scheduler",
+ CANCEL_SCHEDULE_REQUEST: "change-management/scheduler/schedules",
ASSIGN : "?r=",
AAI_GET_SERVICE_INSTANCE_PATH : "aai_get_service_instance/",
AAI_GET_SERVICES : "aai_get_services",
@@ -108,19 +120,31 @@ appDS2
AAI_GET_SERVICES_BY_TYPE : "aai_get_models_by_service_type",
AAI_GET_TENANTS : "aai_get_tenants/",
AAI_SUB_DETAILS_PATH : "aai_sub_details/",
- AAI_GET_VERSION_BY_INVARIANT_ID:"aai_get_version_by_invariant_id/",
- AAI_GET_VNF_DATA_PATH: "aai_get_vnf_data/",
- AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE: "get_vnf_data_by_globalid_and_service_type/",
- AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit",
+ AAI_GET_VERSION_BY_INVARIANT_ID:"aai_get_version_by_invariant_id/",
+ SEARCH_SERVICE_INSTANCES:"search_service_instances",
+ AAI_GET_VNF_DATA_PATH: "aai_get_vnf_data/",
+ AAI_GET_VNF_BY_CUSTOMERID_AND_SERVICETYPE: "get_vnf_data_by_globalid_and_service_type/",
+ AAI_GET_SERVICES_BY_OWNING_ENTITY_ID: 'aai_get_services_by_owning_entity_id',
+ AAI_SUB_VIEWEDIT_PATH : "aai_sub_viewedit",
AAI_GET_VNF_INFO : "aai_get_vnf_information",
+ AAI_GET_PNF_INSTANCE: "aai_get_service_instance_pnfs",
+ AAI_GET_VNF_INSTANCES_LIST: "aai_get_vnf_instances",
+ AAI_GET_PNF_INSTANCES_LIST: "aai_get_pnf_instances",
+ AAI_GET_BY_URI: "aai_get_by_uri/",
+ AAI_GET_CONFIGURATION: "aai_get_configuration/",
+ AAI_GET_TEST_ENVIRONMENTS: "get_operational_environments?operationalEnvironmentType=",
+ GET_CATEGORY_PARAMETERS : "category_parameter",
+ PARAMETER_STANDARDIZATION_FAMILY: "PARAMETER_STANDARDIZATION",
+ TENANT_ISOLATION_FAMILY: "TENANT_ISOLATION",
ASDC_GETMODEL_PATH : "asdc/getModel/",
- CREATE_INSTANCE_PATH : "/models/services/createInstance",
+ CREATE_INSTANCE_PATH : "/models/services/createInstance", AAI_GET_PNF_BY_NAME : "aai_get_pnfs/pnf/",
//1710 scheduler contants
POST_CREATE_NEW_VNF_CHANGE:"post_create_new_vnf_change",
GET_POLICY:"get_policy",
+ WORKFLOW: "workflow",
GET_TIME_SLOTS:"get_time_slots",
SUBMIT_VNF_CHANGE_TIMESLOTS:"submit_vnf_change_timeslots",
-
+
FORWARD_SLASH : "/",
GET_SYSTEM_PROP_VNF_PROV_STATUS_PATH : "get_system_prop_vnf_prov_status",
GET_USER_ID : "getuserID",
@@ -128,15 +152,20 @@ appDS2
INSTANTIATE_PATH : "/instantiate",
INVALID_STRING : "/INVALID_STRING/",
INVALID_STRING_MSO_CREATE_SVC_INSTANCE : "INVALID_STRING_mso_create_svc_instance",
+ MSO: "mso",
MSO_CREATE_NW_INSTANCE : "mso_create_nw_instance",
MSO_CREATE_NW_INSTANCE_PATH : "mso_create_nw_instance/",
MSO_CREATE_SVC_INSTANCE : "mso_create_svc_instance",
MSO_DELETE_SVC_INSTANCE_PATH : "mso_delete_svc_instance/",
- MSO_ACTIVATE_INSTANCE: "mso/mso_activate_service_instance/@serviceInstanceId",
- SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?selectedServiceSubscription=",
- SELECTED_SUB_PATH : "#/instances/subdetails?selectedSubscriber=",
- SELECTEDSERVICEINSTANCE_SUB_PATH : "&selectedServiceInstance=",
- SELECTEDSUBSCRIBER_SUB_PATH : "&selectedSubscriber=",
+ MSO_ACTIVATE_INSTANCE: "mso/mso_activate_service_instance/@serviceInstanceId",
+ MSO_DEACTIVATE_INSTANCE: "mso/mso_deactivate_service_instance/@serviceInstanceId",
+ MSO_CREATE_REALATIONSHIP : "mso_add_relationship",
+ MSO_REMOVE_RELATIONSHIP: "mso_remove_relationship",
+ SELECTED_SERVICE_SUB_PATH : "#/instances/subdetails?",
+ SELECTED_SERVICE_INSTANCE_SUB_PATH : "serviceInstanceIdentifier=",
+ SELECTED_SUBSCRIBER_SUB_PATH : "subscriberId=",
+ OWNING_ENTITY_SUB_PATH : "owningEntity=",
+ PROJECT_SUB_PATH : "project=",
SERVICE_TYPE_LIST_PATH : "#/instances/serviceTypes?serviceTypeList=",
SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH : 'serviceModels.htm#/instances/subscribers',
SERVICES_DIST_STATUS_PATH : "rest/models/services?distributionStatus=",
@@ -150,6 +179,12 @@ appDS2
WELCOME_PATH : "welcome.htm",
IS_PERMITTED_SUB_PATH: "&isPermitted=",
+ //Test Environment Urls:
+ OPERATIONAL_ENVIRONMENT_CREATE : "operationalEnvironment/create",
+ OPERATIONAL_ENVIRONMENT_DEACTIVATE : "operationalEnvironment/deactivate?operationalEnvironment=",
+ OPERATIONAL_ENVIRONMENT_ACTIVATE : "operationalEnvironment/activate?operationalEnvironment=",
+ OPERATIONAL_ENVIRONMENT_STATUS : "operationalEnvironment/requestStatus?requestId=",
+
//Template Urls
AAI_GET_SUBS_URL : "app/vid/scripts/view-models/aaiGetSubs.htm",
AAI_GET_SUBSCRIBER_URL : "app/vid/scripts/view-models/aaiGetSubscriberList.htm",
@@ -158,9 +193,9 @@ appDS2
CREATE_INSTANCE_SERVICE_MODELS_URL : "app/vid/scripts/view-models/createInstanceServiceModels.htm",
INSTANTIATE_URL : "app/vid/scripts/view-models/instantiate.htm",
SERVICE_MODELS : "app/vid/scripts/view-models/serviceModels.htm",
-
-
-
+
+
+
FULL_NAME_MAP : {
"model-invariant-id" : "Model ID",
"model-version-id" : "Model Version ID"
@@ -174,11 +209,18 @@ appDS2
},
MANUAL_TASKS: {
- "retry": "retry",
- "rollback": "rollback",
- "abort": "abort",
- "skip": "skip"
+ "retry": "retry",
+ "rollback": "rollback",
+ "abort": "abort",
+ "skip": "skip"
+ },
+
+ WORKFLOWS: {
+ vnfConfigUpdate: "VNF Config Update",
+ vnfInPlace: "VNF In Place Software Update",
+ update: "update",
+ replace: "replace"
}
-
+
};
})())
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
index 9e3f44cc2..d7f429a6e 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/fieldConstants.js
@@ -37,6 +37,10 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
SUBSCRIBER_NAME: "subscriberName",
SUPPRESS_ROLLBACK: "suppressRollback",
TENANT: "tenant",
+ PROJECT: "project",
+ OWNING_ENTITY : "owningEntity",
+ LINE_OF_BUSINESS : "lineOfBusiness",
+ PLATFORM : "platform",
VNF_TARGETPROVSTATUS: "target",
AAI_GET_FULL_SUBSCRIBERS: "aai_get_full_subscribers",
@@ -83,7 +87,7 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
NETWORKS: "networks",
OPERATIONAL_STATUS: "operational-status",
ORCHESTRATION_STATUS: "orchestration-status",
- PERCENT_PROGRESS: "precentProgress",
+ PERCENT_PROGRESS: "percent-progress",
PERSONA_MODEL_ID: "persona-model-id",
PERSONA_MODEL_VERSION: "persona-model-version",
PERSONA_MODEL_CUSTOMIZATION_ID: "persona-model-customization-id",
@@ -129,7 +133,16 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
SUPPLEMENTORY_DATA_FILE: "supplementoryDataFile",
ZONE_ID: "zone-id",
ZONE_NAME: "zone-name",
-
+ GENERIC_CONFIGURATION: "configuration",
+ CONFIGURATIONS: "configurations",
+ CONFIGURATION: "configuration",
+ CONFIGURATION_NAME: "configuration-name",
+ CONFIGURATION_TYPE: "configuration-type",
+ CONFIGURATION_ID: "configuration-id",
+ PORT: "l-interface",
+ PORT_ID: "interface-id",
+ PORT_NAME: "interface-name",
+ PORT_MIRRORED: "is-port-mirrored"
};
var KEY = {
@@ -140,58 +153,62 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
* NAME values are displayed on GUI pages.
*/
var NAME = {
- AVAILABLE_VOLUME_GROUP: "Available Volume Group",
- INSTANCE_NAME: "Instance Name",
- CUSTOMER_ID: "Customer ID",
- LCP_REGION: "LCP Region",
- LCP_REGION_TEXT: "Legacy Region",
- MODEL_INVARIANT_UUID: "Model Invariant UUID",
- MODEL_NAME: "Model Name",
- MODEL_VERSION: "Model Version",
- MODEL_UUID: "Model UUID",
- MODEL_CUSTOMIZATION_UUID: "Model Customization UUID",
- MODEL_VNF_TYPE: "NF Type",
- MODEL_VNF_ROLE: "NF Role",
- MODEL_VNF_FUNCTION: "NF Function",
- MODEL_VNF_CODE: "NF Naming Code",
- MODEL_CUSTOMIZATION_NAME: "Resource Name",
- PRODUCT_FAMILY: "Product Family",
- AIC_ZONES: "AIC Zone",
- RESOURCE_DESCRIPTION: "Resource Description",
- RESOURCE_NAME: "Resource Name",
- SERVICE_CATEGORY: "Service Category",
- SERVICE_DESCRIPTION: "Service Description",
- SERVICE_INSTANCE_ID: "Service Instance ID",
- SERVICE_INSTANCE_Id: "Service Instance Id",
- SERVICE_INSTANCE_NAME: "Service Instance Name",
- SERVICE_INVARIANT_UUID: "Service Invariant UUID",
- SERVICE_NAME: "Service Name",
- SERVICE_TYPE: "Service Type",
- SERVICE_ROLE: "Service Role",
- SERVICE_UUID: "Service UUID",
- SERVICE_VERSION: "Service Version",
- SUBSCRIBER_NAME: "Subscriber Name",
- MOBILITY: "Mobility",
- SUPPRESS_ROLLBACK: "Suppress Rollback on Failure",
- SDN_C_PRELOAD: "SDN-C Pre-Load",
- UPLOAD_SUPPLEMENTORY_DATA_FILE: "Upload Supplementary Data file",
- SUPPLEMENTORY_DATA_FILE: "Supplementory Data file (JSON format)",
- TENANT: "Tenant",
- USER_SERVICE_INSTANCE_NAME: "User Service Instance Name",
- VF_MODULE_DESCRIPTION: "VF Module Description",
- VF_MODULE_LABEL: "VF Module Label",
- VF_MODULE_TYPE: "VF Module Type",
- VNF_ORCHESTRATION_STATUS: "Orchestration Status",
- VNF_Operational_Status: "Operational Status",
- VNF_Current_Prov_Status: "Current Prov_Status",
- VNF_Target_Prov_Status: "Target Prov Status",
- VNF_VNF_ID: "VNF ID",
- VNF_VNF_Name: "VNF Name",
- VNF_VNF_Type: "VNF Type",
- VNF_Service_ID: "Service ID",
- VNF_In_Maint: "In Maint",
- VFMDULE_CUSTOMIZATIONUUID: "VF Module Model Customization UUID",
- RESOURCE_CUSTOMIZATION_UUID: "Resource Model Customization UUID"
+ AVAILABLE_VOLUME_GROUP: "Available Volume Group",
+ INSTANCE_NAME: "Instance Name",
+ CUSTOMER_ID: "Customer ID",
+ LCP_REGION: "LCP Region",
+ LCP_REGION_TEXT: "Legacy Region",
+ MODEL_INVARIANT_UUID: "Model Invariant UUID",
+ MODEL_NAME: "Model Name",
+ MODEL_VERSION: "Model Version",
+ MODEL_UUID: "Model UUID",
+ MODEL_CUSTOMIZATION_UUID: "Model Customization UUID",
+ MODEL_VNF_TYPE: "NF Type",
+ MODEL_VNF_ROLE: "NF Role",
+ MODEL_VNF_FUNCTION: "NF Function",
+ MODEL_VNF_CODE: "NF Naming Code",
+ MODEL_CUSTOMIZATION_NAME: "Resource Name",
+ PRODUCT_FAMILY: "Product Family",
+ AIC_ZONES: "AIC Zone",
+ RESOURCE_DESCRIPTION : "Resource Description",
+ RESOURCE_NAME : "Resource Name",
+ SERVICE_CATEGORY : "Service Category",
+ SERVICE_DESCRIPTION : "Service Description",
+ SERVICE_INSTANCE_ID : "Service Instance ID",
+ SERVICE_INSTANCE_Id : "Service Instance Id",
+ SERVICE_INSTANCE_NAME : "Service Instance Name",
+ SERVICE_INVARIANT_UUID : "Service Invariant UUID",
+ SERVICE_NAME : "Service Name",
+ SERVICE_TYPE : "Service Type",
+ SERVICE_ROLE: "Service Role",
+ SERVICE_UUID : "Service UUID",
+ SERVICE_VERSION : "Service Version",
+ SUBSCRIBER_NAME : "Subscriber Name",
+ MOBILITY : "Mobility",
+ SUPPRESS_ROLLBACK : "Suppress Rollback on Failure",
+ SDN_C_PRELOAD : "SDN-C Pre-Load",
+ UPLOAD_SUPPLEMENTORY_DATA_FILE : "Upload Supplementary Data file",
+ SUPPLEMENTORY_DATA_FILE : "Supplementory Data file (JSON format)",
+ TENANT : "Tenant",
+ PROJECT : "Project",
+ OWNING_ENTITY : "Owning Entity",
+ LINE_OF_BUSINESS : "Line Of Business",
+ PLATFORM : "Platform",
+ USER_SERVICE_INSTANCE_NAME : "User Service Instance Name",
+ VF_MODULE_DESCRIPTION : "VF Module Description",
+ VF_MODULE_LABEL : "VF Module Label",
+ VF_MODULE_TYPE : "VF Module Type",
+ VNF_ORCHESTRATION_STATUS : "Orchestration Status",
+ VNF_Operational_Status: "Operational Status",
+ VNF_Current_Prov_Status: "Current Prov_Status",
+ VNF_Target_Prov_Status: "Target Prov Status",
+ VNF_VNF_ID : "VNF ID",
+ VNF_VNF_Name: "VNF Name",
+ VNF_VNF_Type: "VNF Type",
+ VNF_Service_ID: "Service ID",
+ VNF_In_Maint: "In Maint",
+ VFMDULE_CUSTOMIZATIONUUID: "VF Module Model Customization UUID",
+ RESOURCE_CUSTOMIZATION_UUID: "Resource Model Customization UUID"
};
/*
@@ -211,6 +228,10 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
SUBSCRIBER_NAME: "Select Subscriber Name",
TARGETPROVSTATUS: "Select Target Prov Status",
TENANT: "Select Tenant Name",
+ PROJECT: "Select Project Name",
+ OWNING_ENTITY: "Select Owning Entity",
+ LINE_OF_BUSINESS : "Select Line Of Business",
+ PLATFORM : "Select Platform",
TEXT_INPUT: "Enter data",
SELECT_SERVICE: "Select a service type",
SELECT_SUB: "Select a subscriber name",
@@ -244,7 +265,11 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
SUBMITTING_REQUEST: "Submitting Request",
SUCCESS_VNF_PROV_STATUS: "Successfully set the VNF's Prov_Status to ",
UNLOCKED: "Unlocked",
-
+ AAI_ACTIVE: "Active",
+ AAI_INACTIVE: "Inactive",
+ AAI_CREATED: "Created",
+ AAI_ENABLED: "Enabled",
+ AAI_DISABLED: "Disabled"
};
var STYLE = {
@@ -416,8 +441,8 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
id: ID.SUBSCRIBER_NAME,
type: PARAMETER.SELECT,
prompt: PROMPT.SUBSCRIBER_NAME,
- isRequired : true,
- isSingleOptionAutoSelected : false
+ isRequired: true,
+ isSingleOptionAutoSelected : false
},
TENANT_DISABLED: {
name: NAME.TENANT,
@@ -433,6 +458,38 @@ appDS2.factory("FIELD", ["PARAMETER", function (PARAMETER) {
isEnabled: true,
prompt: PROMPT.TENANT,
isRequired: true
+ },
+ PROJECT: {
+ name: NAME.PROJECT,
+ id: ID.PROJECT,
+ type: PARAMETER.SELECT,
+ isEnabled: true,
+ prompt: PROMPT.PROJECT,
+ isRequired: false
+ },
+ OWNING_ENTITY: {
+ name: NAME.OWNING_ENTITY,
+ id: ID.OWNING_ENTITY,
+ type: PARAMETER.SELECT,
+ isEnabled: true,
+ prompt: PROMPT.OWNING_ENTITY,
+ isRequired: true
+ },
+ LINE_OF_BUSINESS: {
+ name: NAME.LINE_OF_BUSINESS,
+ id: ID.LINE_OF_BUSINESS,
+ type: PARAMETER.MULTI_SELECT,
+ isEnabled: true,
+ prompt: PROMPT.LINE_OF_BUSINESS,
+ isRequired: false
+ },
+ PLATFORM: {
+ name: NAME.PLATFORM,
+ id: ID.PLATFORM,
+ type: PARAMETER.SELECT,
+ isEnabled: true,
+ prompt: PROMPT.PLATFORM,
+ isRequired: true
}
};
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js
index 693186af4..785f3caba 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/parameterConstants.js
@@ -24,6 +24,7 @@ appDS2.constant("PARAMETER", (function() {
return {
BOOLEAN : "boolean",
SELECT : "select",
+ MULTI_SELECT : "multi_select",
STRING : "string",
NUMBER : "number",
VALID_VALUES : "valid_values",
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json b/vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json
new file mode 100644
index 000000000..5e843e91d
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/version.json
@@ -0,0 +1 @@
+{"Version": "BUILD_NUMBER"} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
index 6ed410a8f..0b69ed556 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/constants/vidConfiguration.js
@@ -64,6 +64,12 @@ appDS2.constant("VIDCONFIGURATION", (function() {
"orchestrationStatus": "active",
"inMaint": false,
"operationalStatus": "out-of-service-path"
+ },
+ {
+ "provStatus": "prov",
+ "orchestrationStatus": "activated",
+ "inMaint": false,
+ "operationalStatus": "out-of-service-path"
}
];
/*
@@ -96,6 +102,11 @@ appDS2.constant("VIDCONFIGURATION", (function() {
*/
var COMPONENT_LIST_NAMED_QUERY_ID = "0367193e-c785-4d5f-9cb8-7bc89dc9ddb7";
var MACRO_SERVICES = [];
+
+ var SCHEDULER_CALLBACK_URL = "";
+
+ var SCHEDULER_PORTAL_URL = "";
+
return {
ASDC_MODEL_STATUS : ASDC_MODEL_STATUS,
MSO_MAX_POLLS : MSO_MAX_POLLS,
@@ -106,6 +117,8 @@ appDS2.constant("VIDCONFIGURATION", (function() {
VNF_VALID_STATUS_LIST : vnfValidStatusList,
UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED : UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED,
MACRO_SERVICES : MACRO_SERVICES,
- COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID
+ COMPONENT_LIST_NAMED_QUERY_ID : COMPONENT_LIST_NAMED_QUERY_ID,
+ SCHEDULER_CALLBACK_URL: SCHEDULER_CALLBACK_URL,
+ SCHEDULER_PORTAL_URL: SCHEDULER_PORTAL_URL
};
})())
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
new file mode 100644
index 000000000..458da3f75
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/AddNetworkNodeController.js
@@ -0,0 +1,78 @@
+/*-
+* ============LICENSE_START=======================================================
+* VID
+* ================================================================================
+* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+* ================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+
+"use strict";
+
+appDS2.controller("AddNetworkNodeController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "CreationService", "$scope", "$window", "$location",
+ function (COMPONENT, FIELD, PARAMETER, DataService, CreationService, $scope, $window, $location) {
+
+ $scope.serviceMetadataFields = [];
+ $scope.tenantList = [];
+ $scope.nodeTemplateFields = {};
+
+ $scope.regexInstanceName = /^([a-z])+([0-9a-z\-_\.]*)$/i;
+ $scope.errorMsg = FIELD.ERROR.INSTANCE_NAME_VALIDATE;
+
+ var handleGetParametersResponse = function(parameters) {
+ $scope.serviceMetadataFields = parameters.summaryList;
+ $scope.tenantList = DataService.getCloudRegionTenantList();
+
+ if(DataService.getPortMirroningConfigFields()){
+ $scope.nodeTemplateFields =DataService.getPortMirroningConfigFields();
+ }else {
+ $scope.nodeTemplateFields = angular.copy(_.keyBy(parameters.userProvidedList, 'id'));
+ }
+
+ $scope.modelName = DataService.getModelInfo(COMPONENT.VNF).modelCustomizationName;
+ };
+
+ CreationService.initializeComponent(COMPONENT.VNF);
+
+ CreationService.getParameters(handleGetParametersResponse);
+
+ $scope.setTenant = function(field) {
+ $scope.nodeTemplateFields.tenant.optionList = _.filter($scope.tenantList, {'cloudRegionId': field.value, 'isPermitted': true});
+ };
+
+ $scope.cancel = function() {
+ $window.history.back();
+ };
+
+ $scope.next = function() {
+ // DataService.setLcpRegion($scope.nodeTemplateFields.lcpRegion.value);
+ // DataService.setModelInstanceName($scope.nodeTemplateFields.instanceName.value);
+ // DataService.setTenant($scope.nodeTemplateFields.tenant.value);
+ // var suppressRollback = ($scope.nodeTemplateFields.suppressRollback.value) ? true : false;
+ // DataService.setSuppressRollback(suppressRollback);
+ DataService.setPortMirroningConfigFields($scope.nodeTemplateFields);
+ $location.path("/serviceProxyConfig");
+ };
+
+ $scope.$on('$routeChangeStart', function (event, next, current) {
+ if(next.$$route.originalPath !=="/serviceProxyConfig"){
+ DataService.setPortMirroningConfigFields(null);
+ }
+ });
+ }]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
index f0653f680..f1dc384c6 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/InstantiationController.js
@@ -26,14 +26,18 @@
"use strict";
appDS2.requires.push('ui.tree');
-
- appDS2.controller("InstantiationController", function ($scope, $route, $location, $timeout, COMPONENT, VIDCONFIGURATION, FIELD, DataService, PropertyService, UtilityService, VnfService, $http, vidService) {
-
+
+ appDS2.controller("InstantiationController", function ($scope, $route, $location, $timeout, COMPONENT, VIDCONFIGURATION, FIELD, DataService, PropertyService, UtilityService, VnfService, $http, vidService, AaiService,PnfService, $q) {
+
$scope.popup = new Object();
$scope.defaultBaseUrl = "";
$scope.responseTimeoutMsec = 60000;
$scope.properties = UtilityService.getProperties();
- $scope.isPermitted = $location.search().isPermitted;
+ $scope.resumeStatus = COMPONENT.RESUME_STATUS;
+ //isPermitted - returned as string from url and converted into boolean
+ $scope.isPermitted = $location.search().isPermitted == "true";
+ $scope.STATUS_CONSTANTS = FIELD.STATUS;
+ $scope.pnfs = [];// PNF data init;
$scope.init = function() {
/*
@@ -63,8 +67,9 @@
// DataService.setServiceInstanceId("mmsc-test-service-instance");
// DataService.setServiceUuid("XXXX-YYYY-ZZZZ");
// DataService.setUserServiceInstanceName("USER_SERVICE_INSTANCE_NAME");
+
}
-
+
//PropertyService.setMsoBaseUrl("testmso");
$scope.convertModel = function(asdcModel) {
@@ -78,7 +83,23 @@
"convertedModel": $scope.convertModel(vidService.getModel()),
"instance": vidService.getInstance()
};
-
+
+ preparePnfs();
+
+
+ function preparePnfs(){
+ var serviceInstance = {
+ globalCustomerId: $location.search().subscriberId,
+ serviceType: $location.search().serviceType,
+ serviceInstanceId: $location.search().serviceInstanceId
+ };
+
+ _setPnf(serviceInstance).then(function(data){
+ $scope.pnfs = data;
+ });
+ }
+
+
$scope.returnVfModules = function (vnfInstance) {
var svcModel = $scope.service.convertedModel;
@@ -213,9 +234,10 @@
DataService.setServiceUuid($scope.service.model.service.uuid);
DataService.setNetworkInstanceId(network.object[FIELD.ID.NETWORK_ID]);
- $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
componentId : COMPONENT.NETWORK,
- callbackFunction : deleteCallbackFunction
+ callbackFunction : deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
});
};
@@ -233,14 +255,8 @@
}
DataService.setMacro($scope.isMacro());
DataService.setInventoryItem(serviceInstance);
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": $scope.service.model.service.invariantUuid,
- "modelVersion": $scope.service.model.service.version,
- "modelNameVersionId": $scope.service.model.service.uuid,
- "modelName": $scope.service.model.service.name,
- "inputs": ""
- });
+ setCurrentServiceModelInfoFromScope();
+
DataService.setSubscriberName(serviceObject[FIELD.ID.SUBSCRIBER_NAME]);
DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
@@ -253,105 +269,150 @@
DataService.setServiceUuid($scope.service.model.service.uuid);
- $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
componentId : COMPONENT.SERVICE,
- callbackFunction : deleteServiceInstanceCallbackFunction
+ callbackFunction : deleteServiceInstanceCallbackFunction,
+ dialogMethod: COMPONENT.DELETE
});
};
- $scope.deleteVfModule = function(serviceObject, vfModule, vnf) {
-
- console.log("Removing VF-Module " + vfModule.name);
-
+ function populate_popup_vfModule(serviceObject, vfModule, vnf){
var serviceInstance = serviceObject.object;
- DataService.setInventoryItem(vfModule.object);
-
- var svcModel = $scope.service.convertedModel;
+ DataService.setInventoryItem(vfModule.object);
- //var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
- var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
- var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];;
- var vfModuleInstanceID = vfModule.object[FIELD.ID.VF_MODULE_ID];
- if (vfModuleInstanceID == null) {
- vfModuleInstanceID = "";
- }
-
- var vnfModel = null;
- var vfModuleModel = null;
-
- DataService.setModelInfo(COMPONENT.VF_MODULE, {
- "modelInvariantId": "",
- "modelVersion": "",
- "modelNameVersionId": "",
- "modelCustomizationName": "",
- "customizationUuid": "",
- "modelName": "",
- "inputs": ""
- });
-
- if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
- if ( (svcModel.isNewFlow) && (vnfModelCustomizationUuid != null ) ) {
- vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
-
- var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
- if ( !($scope.isObjectEmpty(vnfModel.vfModules) ) && UtilityService.hasContents(vfModuleCustomizationUuid) ) {
-
- vfModuleModel = vnfModel.vfModules[vfModuleCustomizationUuid];
-
- }
- }
- else {
- // old flow
- if (vnfModelVersionId != null ) {
- vnfModel = svcModel.vnfs[vnfModelVersionId];
- }
- //var vfModuleInvariantUuid = vfModule.object[FIELD.ID.MODEL_INVAR_ID];
- var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
- if ( (!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.vfModules))) &&
- UtilityService.hasContents(vfModuleModelVersionId) ) {
- vfModuleModel = vnfModel.vfModules[vfModuleModelVersionId];
- }
- }
- if ( !($scope.isObjectEmpty(vfModuleModel)) ) {
- DataService.setModelInfo(COMPONENT.VF_MODULE, {
- "modelInvariantId": vfModuleModel.invariantUuid,
- "modelVersion": vfModuleModel.version,
- "modelNameVersionId": vfModuleModel.uuid,
- "modelCustomizationName": vfModuleModel.modelCustomizationName,
- "customizationUuid": vfModuleModel.customizationUuid,
- "modelName": vfModuleModel.name,
- "inputs": ""
- });
- }
- }
+ var svcModel = $scope.service.convertedModel;
- DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
- DataService.setVfModuleInstanceId(vfModuleInstanceID);
-
- DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
- DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
- DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
-
- DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
- DataService.setServiceInstanceName($scope.service.instance.name);
-
- DataService.setServiceName($scope.service.model.service.name);
-
- DataService.setServiceUuid($scope.service.model.service.uuid);
+ //var vnfModelInvariantUuid = vnf.object[FIELD.ID.MODEL_INVAR_ID];
+ var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];;
+ var vfModuleInstanceID = vfModule.object[FIELD.ID.VF_MODULE_ID];
+ if (vfModuleInstanceID == null) {
+ vfModuleInstanceID = "";
+ }
+
+ var vnfModel = null;
+ var vfModuleModel = null;
+
+ DataService.setModelInfo(COMPONENT.VF_MODULE, {
+ "modelInvariantId": "",
+ "modelVersion": "",
+ "modelNameVersionId": "",
+ "modelCustomizationName": "",
+ "customizationUuid": "",
+ "modelName": "",
+ "inputs": ""
+ });
+
+ if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
+ if ( (svcModel.isNewFlow) && (vnfModelCustomizationUuid != null ) ) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+
+ var vfModuleCustomizationUuid = vfModule.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ if ( !($scope.isObjectEmpty(vnfModel.vfModules) ) && UtilityService.hasContents(vfModuleCustomizationUuid) ) {
+
+ vfModuleModel = vnfModel.vfModules[vfModuleCustomizationUuid];
+
+ }
+ }
+ else {
+ // old flow
+ if (vnfModelVersionId != null ) {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ //var vfModuleInvariantUuid = vfModule.object[FIELD.ID.MODEL_INVAR_ID];
+ var vfModuleModelVersionId = vfModule.object[FIELD.ID.MODEL_VERSION_ID];
+ if ( (!($scope.isObjectEmpty(vnfModel))) && (!($scope.isObjectEmpty(vnfModel.vfModules))) &&
+ UtilityService.hasContents(vfModuleModelVersionId) ) {
+ vfModuleModel = vnfModel.vfModules[vfModuleModelVersionId];
+ }
+ }
+ if ( !($scope.isObjectEmpty(vfModuleModel)) ) {
+ DataService.setModelInfo(COMPONENT.VF_MODULE, {
+ "modelInvariantId": vfModuleModel.invariantUuid,
+ "modelVersion": vfModuleModel.version,
+ "modelNameVersionId": vfModuleModel.uuid,
+ "modelCustomizationName": vfModuleModel.modelCustomizationName,
+ "customizationUuid": vfModuleModel.customizationUuid,
+ "modelName": vfModuleModel.name,
+ "inputs": ""
+ });
+ }
+ }
+
+ DataService.setVnfInstanceId(vnf.object[FIELD.ID.VNF_ID]);
+ DataService.setVfModuleInstanceId(vfModuleInstanceID);
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+
+ DataService.setServiceName($scope.service.model.service.name);
+
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ }
+
+ $scope.deleteVfModule = function(serviceObject, vfModule, vnf) {
+
+ console.log("Removing VF-Module " + vfModule.name);
+
+ populate_popup_vfModule(serviceObject, vfModule, vnf);
- $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
componentId : COMPONENT.VF_MODULE,
- callbackFunction : deleteCallbackFunction
+ callbackFunction : deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
});
return;
};
- $scope.deleteVnf = function(serviceObject, vnf) {
+ function setCurrentServiceModelInfoFromScope(){
+ DataService.setModelInfo(COMPONENT.SERVICE, {
+ "modelInvariantId": $scope.service.model.service.invariantUuid,
+ "modelVersion": $scope.service.model.service.version,
+ "modelNameVersionId": $scope.service.model.service.uuid,
+ "modelName": $scope.service.model.service.name,
+ "inputs": ""
+ });
+ };
+
+ function setCurrentVNFModelInfo(vnf){
+ var svcModel = $scope.service.convertedModel;
+ var vnfModel;
+ var vnfModelCustomizationUuid = vnf.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+ var vnfModelVersionId = vnf.object[FIELD.ID.MODEL_VERSION_ID];
+ if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
+ if ( (svcModel.isNewFlow) && (vnfModelCustomizationUuid != null ) ) {
+ vnfModel = svcModel.vnfs[vnfModelCustomizationUuid];
+ }
+ else {
+ vnfModel = svcModel.vnfs[vnfModelVersionId];
+ }
+ if ( !($scope.isObjectEmpty(vnfModel) ) ) {
+
+ DataService.setModelInfo(COMPONENT.VNF, {
+ "modelInvariantId": vnfModel.invariantUuid,
+ "modelVersion": vnfModel.version,
+ "modelNameVersionId": vnfModel.uuid,
+ "modelCustomizationName": vnfModel.modelCustomizationName,
+ "customizationUuid": vnfModel.customizationUuid,
+ "modelName": vnfModel.name,
+ "inputs": ""
+ });
+ }
+ }
+
+
+
+ }
+ $scope.deleteVnf = function(serviceObject, vnf) {
console.log("Removing VNF " + vnf.name);
var serviceInstance = serviceObject.object;
@@ -424,9 +485,10 @@
DataService.setServiceUuid($scope.service.model.service.uuid);
- $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
componentId : COMPONENT.VNF,
- callbackFunction : deleteCallbackFunction
+ callbackFunction : deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
});
};
@@ -517,8 +579,9 @@
DataService.setVnfInstanceId(vnf.nodeId);
DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
- $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
componentId : COMPONENT.VOLUME_GROUP,
+ dialogMethod: COMPONENT.DELETE
});
};
@@ -585,10 +648,11 @@
DataService.setVnfInstanceId(vnf.nodeId);
DataService.setVolumeGroupInstanceId(volumeGroup.nodeId);
- $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
- componentId : COMPONENT.VOLUME_GROUP,
- callbackFunction : deleteCallbackFunction
- });
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId : COMPONENT.VOLUME_GROUP,
+ callbackFunction : deleteOrResumeCallback,
+ dialogMethod: COMPONENT.DELETE
+ });
};
$scope.describeNetwork = function(serviceObject, networkObject) {
@@ -783,14 +847,8 @@
"inputs": "",
"displayInputs": netModel.displayInputs
});
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": $scope.service.model.service.invariantUuid,
- "modelVersion": $scope.service.model.service.version,
- "modelNameVersionId": $scope.service.model.service.uuid,
- "modelName": $scope.service.model.service.name,
- "inputs": ""
- });
+ setCurrentServiceModelInfoFromScope();
+
$scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
componentId : COMPONENT.NETWORK,
@@ -814,6 +872,8 @@
DataService.setServiceInstanceId($scope.service.instance.id);
DataService.setServiceName($scope.service.model.service.name);
+ console.log ( "existingVnfs: " );
+ console.log (JSON.stringify ( existingVnfs, null, 4));
console.log ( "existingVnfs: " ); console.log (JSON.stringify ( existingVnfs, null, 4));
var vnf_type = "";
var vnf_role = "";
@@ -833,7 +893,7 @@
vnf_code = vnf.nfCode;
}
DataService.setModelInfo(COMPONENT.VNF, {
- "modelType": "vnf",
+ "modelType": vnf.isPnf ? "pnf" : "vnf",
"modelInvariantId": vnf.invariantUuid,
"modelVersion": vnf.version,
"modelNameVersionId": vnf.uuid,
@@ -845,23 +905,27 @@
"vnfType": vnf_type,
"vnfRole": vnf_role,
"vnfFunction": vnf_function,
- "vnfCode": vnf_code
+ "vnfCode": vnf_code,
+ "properties": vnf.properties
});
DataService.setModelInstanceName($scope.service.model.service.name);
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": $scope.service.model.service.invariantUuid,
- "modelVersion": $scope.service.model.service.version,
- "modelNameVersionId": $scope.service.model.service.uuid,
- "modelName": $scope.service.model.service.name,
- "inputs": ""
- });
-
- $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
- componentId : COMPONENT.VNF,
- callbackFunction : createVnfCallbackFunction
- });
+ setCurrentServiceModelInfoFromScope();
+
+ if (vnf.isConfig) {
+ DataService.setServiceProxies($scope.service.model.serviceProxies);
+ DataService.setSourceServiceProxies(vnf.sourceNodes);
+ DataService.setCollectorServiceProxies(vnf.collectorNodes);
+ DataService.setConfigurationByPolicy(vnf.isConfigurationByPolicy);
+ $location.path("/addNetworkNode");
+ } else if(vnf.isPnf){
+ $location.path("/pnfSearchAssociation");
+ } else {
+ $scope.$broadcast(COMPONENT.CREATE_COMPONENT, {
+ componentId: COMPONENT.VNF,
+ callbackFunction: createVnfCallbackFunction
+ });
+ }
};
$scope.addVfModuleInstance = function(vnfInstance, vfModuleModel) {
@@ -898,20 +962,11 @@
availableVolumeGroupList.push({"instance": volumeGroupInstance});
});
- if (vfModuleModel.volumeGroupAllowed) {
- DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
- }
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": $scope.service.model.service.invariantUuid,
- "modelVersion": $scope.service.model.service.version,
- "modelNameVersionId": $scope.service.model.service.uuid,
- "modelName": $scope.service.model.service.name,
- "inputs": ""
- });
+ DataService.setAvailableVolumeGroupList(availableVolumeGroupList);
+ setCurrentServiceModelInfoFromScope();
DataService.setVnfInstanceId(vnfInstance.object[FIELD.ID.VNF_ID]);
-
+
DataService.setModelInfo(COMPONENT.VNF, {
"modelInvariantId": vnfModel.invariantUuid,
"modelVersion": vnfModel.version,
@@ -954,6 +1009,7 @@
DataService.setServiceInstanceName($scope.service.instance.name);
DataService.setServiceInstanceId($scope.service.instance.id);
DataService.setServiceName($scope.service.model.service.name);
+ setCurrentServiceModelInfoFromScope();
DataService.setModelInfo(COMPONENT.SERVICE, {
"modelInvariantId": $scope.service.model.service.invariantUuid,
@@ -976,7 +1032,7 @@
else {
vnfModel = svcModel.vnfs[vnfModelVersionId];
}
-
+
DataService.setModelInfo(COMPONENT.VNF, {
"modelInvariantId": vnfModel.invariantUuid,
"modelVersion": vnfModel.version,
@@ -1003,6 +1059,76 @@
});
};
+ $scope.resume = function(serviceObject, vfModule, vnfModel) {
+ populate_popup_vfModule(serviceObject, vfModule, vnfModel);
+ setCurrentVNFModelInfo(vnfModel);
+ DataService.setVfModuleInstanceName(vfModule.object[FIELD.ID.VF_MODULE_NAME]);
+ setCurrentServiceModelInfoFromScope();
+ $scope.$broadcast(COMPONENT.DELETE_RESUME_COMPONENT, {
+ componentId : COMPONENT.VF_MODULE,
+ callbackFunction : deleteOrResumeCallback,
+ dialogMethod: COMPONENT.RESUME
+ });
+ };
+
+ $scope.deleteConfiguration = function (serviceObject, configuration) {
+ console.log("Deleting Configuration " + configuration.name);
+
+ var serviceInstance = serviceObject.object;
+ var svcModel = $scope.service.convertedModel;
+ var configModel;
+ DataService.setInventoryItem(configuration.object);
+ // set model default and override later if found
+ DataService.setModelInfo(COMPONENT.CONFIGURATION, {});
+
+ if ( configuration.object != null ) {
+
+ //var netModelInvariantUuid = network.object[FIELD.ID.MODEL_INVAR_ID];
+ var configModelVersionId = configuration.object[FIELD.ID.MODEL_VERSION_ID]; // model uuid
+ var configModelCustomizationUuid = configuration.object[FIELD.ID.MODEL_CUSTOMIZATION_ID];
+
+ //configurations added to vnfs list, in order to be part of the "Add VNF" drop-down list
+ if ( (!($scope.isObjectEmpty(svcModel))) && ( !($scope.isObjectEmpty(svcModel.vnfs) ) ) ) {
+ if ( (svcModel.isNewFlow) && (UtilityService.hasContents(configModelCustomizationUuid) ) ) {
+ configModel = svcModel.vnfs[configModelCustomizationUuid];
+ }
+ else {
+
+ if ( UtilityService.hasContents(configModelVersionId) ) {
+ configModel = svcModel.vnfs[configModelVersionId];
+ }
+
+ }
+ }
+ }
+ if (!($scope.isObjectEmpty(configModel) ) ) {
+ DataService.setModelInfo(COMPONENT.CONFIGURATION, {
+ "modelInvariantId": configModel.invariantUuid,
+ "modelVersion": configModel.version,
+ "modelNameVersionId": configModel.uuid,
+ "modelCustomizationName": configModel.modelCustomizationName,
+ "customizationUuid": configModel.customizationUuid,
+ "modelName": configModel.name,
+ "inputs": ""
+ });
+ }
+
+ DataService.setSubscriberName(serviceObject[COMPONENT.SUBSCRIBER_NAME]);
+ DataService.setServiceType(serviceObject[COMPONENT.SERVICE_TYPE]);
+ DataService.setServiceInstanceId(serviceInstance[FIELD.ID.SERVICE_INSTANCE_ID]);
+
+ DataService.setGlobalCustomerId(serviceObject[FIELD.ID.GLOBAL_CUST_ID]);
+ DataService.setServiceInstanceName($scope.service.instance.name);
+ DataService.setServiceName($scope.service.model.service.name);
+ DataService.setServiceUuid($scope.service.model.service.uuid);
+ DataService.setConfigurationInstanceId(configuration.object[FIELD.ID.CONFIGURATION_ID]);
+
+ $scope.$broadcast(COMPONENT.DELETE_COMPONENT, {
+ componentId : COMPONENT.CONFIGURATION,
+ callbackFunction : deleteCallbackFunction
+ });
+ };
+
$scope.resetProgress = function() {
$scope.percentProgress = 0;
$scope.progressClass = FIELD.STYLE.PROGRESS_BAR_INFO;
@@ -1055,7 +1181,35 @@
$scope.reloadRoute = function() {
$route.reload();
}
-
+
+
+
+ /*
+ Private metthods
+ */
+
+ /*
+ setPnf
+ * set the controller pnf param using api call
+ * return: void
+ */
+ function _setPnf(data){ // data is the $scope.service.instance object
+ return PnfService.getPnfs(data)
+ .then(
+ function success(response){
+ return response.data;
+ // * can add here changes on the data that are needed to the view ( filter, ect..)
+ },
+ function error(error){
+ console.error(error);
+ }
+ );
+ }
+
+ /*
+ Callbaks functions
+
+ */
var updateProvStatusVnfCallbackFunction = function(response) {
$scope.callbackResults = "";
var color = FIELD.ID.COLOR_NONE;
@@ -1112,7 +1266,7 @@
};
- var deleteCallbackFunction = function(response) {
+ var deleteOrResumeCallback = function(response) {
$scope.callbackResults = "";
var color = FIELD.ID.COLOR_NONE;
$scope.callbackStyle = {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
index 8844d40a8..967a39002 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceModelController.js
@@ -41,14 +41,13 @@
$scope.services = [];
if (response.data && angular.isArray(response.data.services)) {
wholeData = response.data.services;
- $scope.services = $scope.filterDataWithHigerVersion(wholeData);
+ $scope.services = $scope.filterDataWithHigherVersion(wholeData);
$scope.viewPerPage=10;
$scope.totalPage=$scope.services.length/$scope.viewPerPage;
$scope.sortBy=COMPONENT.NAME;
$scope.scrollViewPerPage=2;
$scope.currentPage=1;
$scope.searchCategory;
- $scope.searchString="";
$scope.currentPageNum=1;
$scope.isSpinnerVisible = false;
$scope.isProgressVisible = false;
@@ -61,67 +60,35 @@
}, function errorCallback(response) {
console.log("Error: " + response);
});
- }
- $scope.isFiltered=function(arr,obj){
- var filtered = false;
- if(arr.length>0){
- for(var i=0;i<arr.length;i++){
- if((arr[i].name == obj.name) && (obj.invariantUUID == arr[i].invariantUUID)){
- filtered = true;
- }
- }
- }
- return filtered;
- }
+ };
+
var wholeData=[];
- $scope.filterDataWithHigerVersion = function(serviceData){
- var fiterDataServices = [];
- for(var i=0;i<serviceData.length;i++){
- var higherVersion = serviceData[i];
- if(!$scope.isFiltered(fiterDataServices,serviceData[i])){
- for(var j=i;j<serviceData.length;j++){
- if((serviceData[i].invariantUUID.trim() == serviceData[j].invariantUUID.trim()) && (serviceData[i].name.trim() == serviceData[j].name.trim()) && (parseFloat(serviceData[j].version.trim())>=parseFloat(serviceData[i].version.trim()))){
- var data = $scope.isThisHigher(fiterDataServices,serviceData[j]);
- if(data.isHigher){
- fiterDataServices[data.index] = serviceData[j];
- }
- }
- }
- }
- }
- return fiterDataServices;
- }
- $scope.isThisHigher = function(arr,obj){
- var returnObj = {
- isHigher:false,
- index:0
- };
- if(arr.length>0){
- var isNotMatched = true;
- for(var i=0;i<arr.length;i++){
- if((arr[i].name == obj.name) && (arr[i].invariantUUID == obj.invariantUUID ) && (arr[i].version<obj.version) ){
- isNotMatched = false;
- returnObj = {
- isHigher:true,
- index:i
- };
+ $scope.filterDataWithHigherVersion = function(serviceData){
+ var delimiter = '$$';
+ var fiterDataServices = {};
+ for(var i=0;i<serviceData.length;i++) {
+ var index = serviceData[i].invariantUUID.trim() + delimiter + serviceData[i].name.trim();
+ if(!fiterDataServices[index]) {
+ var hasPreviousVersion = false;
+ fiterDataServices[index] = {
+ service: serviceData[i],
+ hasPreviousVersion: false
+ };
+ }
+ else {
+ fiterDataServices[index].hasPreviousVersion = true;
+ if(parseFloat(serviceData[i].version.trim())>parseFloat(fiterDataServices[index].service.version.trim())) {
+ fiterDataServices[index].service = serviceData[i];
}
}
- if(isNotMatched && !$scope.isFiltered(arr,obj)){
- returnObj = {
- isHigher:true,
- index:arr.length
- };
- }
- }else{
- returnObj = {
- isHigher:true,
- index:0
- }
}
- return returnObj;
- }
+ return Object.keys(fiterDataServices).map(function(key) {
+ var service = fiterDataServices[key].service;
+ service.hasPreviousVersion = fiterDataServices[key].hasPreviousVersion;
+ return service;
+ });
+ };
$scope.init = function() {
var msecs = PropertyService.retrieveMsoMaxPollingIntervalMsec();
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
new file mode 100644
index 000000000..6e7ad50cf
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/ServiceProxyConfigController.js
@@ -0,0 +1,342 @@
+/*-
+* ============LICENSE_START=======================================================
+* VID
+* ================================================================================
+* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+* ================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+
+"use strict";
+
+appDS2.controller("ServiceProxyConfigController", ["COMPONENT", "$log", "FIELD", "PARAMETER", "DataService", "CreationService", "$scope", "$window", "$location", "AaiService", "$uibModal", "UtilityService", "$timeout",
+ function (COMPONENT, $log, FIELD, PARAMETER, DataService, CreationService, $scope, $window, $location, AaiService, $uibModal, UtilityService, $timeout) {
+
+ $scope.selectedMetadata = {};
+
+ $scope.serviceMetadataFields = [];
+ $scope.nodeTemplateFields = {};
+
+ $scope.configurationByPolicy = DataService.getConfigurationByPolicy();
+
+ $scope.collectorType = $scope.configurationByPolicy ? 'pnf' : 'vnf'; //default
+ $scope.collectorInstance;
+ $scope.collectorInstanceName = "";
+ $scope.collectorInstanceList = null;
+ $scope.collectorMetadata = [];
+ $scope.collectorNoResults = false;
+
+ $scope.sourceInstance;
+ $scope.sourceInstanceName = "";
+ $scope.sourceInstanceList = null;
+ $scope.sourceMetadata = [];
+ $scope.sourceNoResults = false;
+
+ $scope.errorMsg = FIELD.ERROR.INSTANCE_NAME_VALIDATE;
+
+ $scope.modelName = DataService.getModelInfo(COMPONENT.VNF).modelCustomizationName;
+
+ $scope.serviceTypes = [];
+
+ function init() {
+ loadServiceTypes();
+
+ generateMetadata(sourceServiceProxy);
+ generateMetadata(collectorServiceProxy);
+
+ }
+
+ function setDefaultCollectorServiceType() {
+ const configServiceType = DataService.getServiceType();
+ $scope.collectorServiceType = mustFind($scope.serviceTypes, {"service-type": configServiceType});
+ loadCollectorProxies();
+ }
+
+ function handleGetServiceTypesResponse(response) {
+ $scope.serviceTypes = response.data;
+ setDefaultCollectorServiceType();
+ }
+
+ var handleGetParametersResponse = function(parameters) {
+ $scope.serviceMetadataFields = parameters.summaryList;
+ $scope.nodeTemplateFields = DataService.getPortMirroningConfigFields();
+ };
+
+ var mustFind = function (collection, predicate) {
+ const result = _.find(collection, predicate);
+ const description = "result for find " + JSON.stringify(predicate);
+ UtilityService.checkUndefined(description, result);
+ $log.debug(description, result);
+ return result;
+ };
+
+
+ $scope.back = function() {
+ $window.history.back();
+ };
+
+
+ function loadServiceTypes() {
+ const subscriberId = DataService.getGlobalCustomerId();
+ AaiService.getSubscriberServiceTypes(subscriberId)
+ .then(handleGetServiceTypesResponse)
+ .catch(function (error) {
+ $log.error(error);
+ });
+ }
+
+ var modalInstance;
+
+ $scope.create = function() {
+ $scope.disableCreate= true;
+ var portMirroringConfigFields = DataService.getPortMirroningConfigFields();
+ portMirroringConfigFields.sourceInstance = mustFind($scope.sourceInstanceList, {'id': $scope.sourceInstance});
+ portMirroringConfigFields.destinationInstance = mustFind($scope.collectorInstanceList, {'id': $scope.collectorInstance});
+
+ var selectedVnfsList;
+
+ if ($scope.configurationByPolicy) {
+ selectedVnfsList = [
+ portMirroringConfigFields.sourceInstance.properties
+ ];
+ } else {
+ selectedVnfsList = [
+ portMirroringConfigFields.sourceInstance.properties,
+ portMirroringConfigFields.destinationInstance.properties
+ ];
+ }
+
+ AaiService.getVnfVersionsByInvariantId(
+ selectedVnfsList.map(function(x) {
+ return UtilityService.checkUndefined("model-invariant-id", x['model-invariant-id']);
+ })
+ )
+ .then(function (response) {
+ $log.debug("getVnfVersionsByInvariantId: response", response);
+
+ selectedVnfsList
+ .map(function (inOutProperties) {
+ const model = mustFind(response.data.model, {'model-invariant-id': inOutProperties['model-invariant-id']});
+
+ const modelVer = mustFind(model["model-vers"]["model-ver"], {'model-version-id': inOutProperties['model-version-id']});
+
+ inOutProperties['model-version'] = modelVer['model-version'];
+ inOutProperties['model-name'] = modelVer['model-name'];
+ UtilityService.checkUndefined("model-version", modelVer);
+ });
+ })
+
+ .then(function () {
+ var requestParams = {
+ configurationModelInfo: DataService.getModelInfo(COMPONENT.VNF),
+ relatedTopModelsInfo: DataService.getModelInfo(COMPONENT.SERVICE),
+ portMirroringConfigFields:portMirroringConfigFields,
+ attuuid: DataService.getLoggedInUserId(),
+ topServiceInstanceId: DataService.getServiceInstanceId(),
+ configurationByPolicy: $scope.configurationByPolicy,
+ callbackFunction: updateViewCallbackFunction
+ };
+
+ modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+ controller : "msoCommitModalController",
+ backdrop: true,
+ resolve: {
+ msoType: function () {
+ return COMPONENT.MSO_CREATE_REQ;
+ },
+ requestParams: function () {
+ return requestParams;
+ }
+ }
+ });
+ })
+ .catch(function (error) {
+ $log.error("error while configuration create", error);
+ $scope.disableCreate= false;
+ });
+ };
+
+ $scope.openMetadataModal = function(name) {
+ $scope.selectedMetadata = $scope[name];
+ modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/service-metadata/service-metadata.html',
+ backdrop: false,
+ scope : $scope,
+ resolve: {
+ }
+ });
+ };
+
+ $scope.cancel = function() {
+ modalInstance.dismiss('cancel');
+ };
+
+ var updateViewCallbackFunction = function(response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color" : color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function() {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $window.history.go(-2);
+ } else {
+ $scope.disableCreate=false;
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color" : color
+ };
+ }, 500);
+ };
+
+ CreationService.initializeComponent(COMPONENT.VNF);
+ CreationService.initializeComponent(COMPONENT.SERVICE);
+ CreationService.getParameters(handleGetParametersResponse);
+
+ var sourceServiceProxies = DataService.getSourceServiceProxies();
+ var collectorServiceProxies = DataService.getCollectorServiceProxies();
+ var serviceProxiesList = DataService.getServiceProxies();
+
+ var sourceServiceProxy = {
+ serviceList: sourceServiceProxies,
+ instanceListScopePropertyName: "sourceInstanceList",
+ name: "sourceInstanceName",
+ metadata: "sourceMetadata",
+ noResults: "sourceNoResults"
+ };
+
+ var collectorServiceProxy = {
+ serviceList: collectorServiceProxies,
+ instanceListScopePropertyName: "collectorInstanceList",
+ name: "collectorInstanceName",
+ metadata: "collectorMetadata",
+ noResults: "collectorNoResults"
+ };
+
+ $scope.onSourceServiceTypeSelected = function() {
+ clearSourceProxySelection();
+ loadSourceProxies();
+ };
+
+ $scope.onCollectorServiceTypeSelected = function() {
+ clearCollectorProxySelection();
+ loadCollectorProxies();
+ };
+
+ function clearSourceProxySelection() {
+ $scope.sourceInstance = undefined;
+ }
+
+ function clearCollectorProxySelection() {
+ $scope.collectorInstance = undefined;
+ }
+
+ function loadSourceProxies() {
+ var serviceProxy = serviceProxiesList[(sourceServiceProxy.serviceList)[0]];
+ var selectedServiceType = $scope.sourceServiceType['service-type'];
+ loadProxyInstances(sourceServiceProxy, selectedServiceType, serviceProxy);
+ }
+
+ function loadCollectorProxies() {
+ var serviceProxy = serviceProxiesList[(collectorServiceProxy.serviceList)[0]];
+ var selectedServiceType = $scope.collectorServiceType['service-type'];
+ loadProxyInstances(collectorServiceProxy, selectedServiceType, serviceProxy);
+ }
+
+ function loadProxyInstances(service, serviceType, serviceProxy) {
+ $scope[service.instanceListScopePropertyName] = null;
+ // $scope.collectorType = $scope.configurationByPolicy ? 'pnf' : 'vnf';
+ var configNodeTemplateFields = DataService.getPortMirroningConfigFields();
+ if (service.name == "collectorInstanceName" && $scope.configurationByPolicy) {
+ var configurationModel = DataService.getModelInfo(COMPONENT.VNF);
+ AaiService.getPnfInstancesList(
+ DataService.getGlobalCustomerId(),
+ serviceType,
+ serviceProxy.sourceModelUuid,
+ serviceProxy.sourceModelInvariant,
+ configNodeTemplateFields.lcpRegion.value,
+ configurationModel.properties.equip_vendor,
+ configurationModel.properties.equip_model
+ )
+ .then(function (response) {
+ var results = response.results || [];
+ $scope[service.instanceListScopePropertyName] = results;
+ $scope[service.noResults] = (results.length === 0);
+ })
+ .catch(function (error) {
+ $scope[service.noResults] = true;
+ $log.error("No pnf instance found for " + service.name, error);
+ });
+ } else {
+ AaiService.getVnfInstancesList(
+ DataService.getGlobalCustomerId(),
+ serviceType,
+ serviceProxy.sourceModelUuid,
+ serviceProxy.sourceModelInvariant,
+ configNodeTemplateFields.lcpRegion.value
+ )
+ .then(function (response) {
+ var results = response.results || [];
+ $scope[service.instanceListScopePropertyName] = results;
+ $scope[service.noResults] = (results.length === 0);
+ })
+ .catch(function (error) {
+ $scope[service.noResults] = true;
+ $log.error("No vnf instance found for " + service.name, error);
+ });
+ }
+ }
+
+ function generateMetadata(service) {
+ const serviceProxy = serviceProxiesList[(service.serviceList)[0]];
+ $scope[service.name] = serviceProxy.name;
+
+ $scope[service.metadata] = [
+ {"name" :"Name" ,"value" : serviceProxy.name},
+ {"name" :"Version",value : serviceProxy.version},
+ {"name" :"Description", value : serviceProxy.description},
+ {"name" :"Type", value : serviceProxy.type},
+ {"name" :"Invariant UUID", value : serviceProxy.invariantUuid},
+ {"name" :"UUID", value : serviceProxy.uuid},
+ {"name" :"Customization UUID", value : serviceProxy.customizationUuid},
+ {"name" :"Source Model Uuid", value : serviceProxy.sourceModelUuid},
+ {"name" :"Source Model Invariant", value : serviceProxy.sourceModelInvariant},
+ {"name" :"Source Model Name", value : serviceProxy.sourceModelName}
+ ];
+ }
+
+ init();
+ $scope.$on('$routeChangeStart', function (event, next, current) {
+ if(next.$$route.originalPath!=="/addNetworkNode"){
+ DataService.setPortMirroningConfigFields(null);
+ }
+ });
+ }]);
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
index b611def42..6129fd96a 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/VidApp.js
@@ -20,7 +20,7 @@
(function () {
'use strict';
-
+
appDS2.config(['$routeProvider', '$locationProvider', function ($routeProvider) {
$routeProvider
.when('/models/services', {
@@ -32,30 +32,47 @@
templateUrl: 'app/vid/scripts/view-models/createInstanceServiceModels.htm'
})
.when('/instances/services', {
- templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm",
+ templateUrl : "app/vid/scripts/view-models/aaiGetSubs.htm",
controller : "aaiSubscriberController"
})
.when('/instances/subscribers', {
- templateUrl : "app/vid/scripts/view-models/aaiGetSubscriberList.htm",
+ templateUrl : "app/vid/scripts/view-models/aaiGetSubscriberList.htm",
controller : "aaiSubscriberController"
})
.when('/instances/serviceTypes', {
- templateUrl : "app/vid/scripts/view-models/aaiServiceTypes.htm",
+ templateUrl : "app/vid/scripts/view-models/aaiServiceTypes.htm",
controller : "aaiSubscriberController"
})
.when('/instances/subdetails', {
- templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm",
+ templateUrl : "app/vid/scripts/view-models/aaiSubDetails.htm",
controller : "aaiSubscriberController"
})
.when('/change-management', {
templateUrl : "app/vid/scripts/view-models/change-management.html",
controller : "changeManagementController",
controllerAs: 'vm'
- })
+ })
+ .when('/testEnvironments', {
+ templateUrl : "app/vid/scripts/view-models/testEnvironments.htm",
+ controller : "testEnvironmentsController",
+ controllerAs: 'vm'
+ })
.when('/instantiate', {
controller: 'InstantiationController',
templateUrl: 'app/vid/scripts/view-models/instantiate.htm'
})
+ .when('/addNetworkNode', {
+ controller: 'AddNetworkNodeController',
+ templateUrl: 'app/vid/scripts/view-models/addNetworkNode.htm'
+ })
+ .when('/pnfSearchAssociation', {
+ controller: 'pnfSearchAssociationController',
+ templateUrl: 'app/vid/scripts/view-models/pnfSearchAssociation.htm'
+ })
+ .when('/serviceProxyConfig', {
+ controller: 'ServiceProxyConfigController',
+ templateUrl: 'app/vid/scripts/view-models/serviceProxyConfig.htm'
+ })
.otherwise({
redirectTo: '/models/services'
});
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
index a86c1b1b4..d58b83f69 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/aaiSubscriberController.js
@@ -20,8 +20,8 @@
"use strict";
-appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService",
- function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService) {
+appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER", "DataService", "PropertyService", "$scope", "$http", "$timeout", "$location", "$log", "$route", "$uibModal", "VIDCONFIGURATION", "UtilityService", "vidService", "AaiService", "MsoService", "OwningEntityService", "$q",
+ function (COMPONENT, FIELD, PARAMETER, DataService, PropertyService, $scope, $http, $timeout, $location, $log, $route, $uibModal, VIDCONFIGURATION, UtilityService, vidService, AaiService, MsoService, OwningEntityService, $q) {
$scope.showVnfDetails = function (vnf) {
console.log("showVnfDetails");
@@ -121,253 +121,215 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
DataService.setSubscribers($scope.custSubList);
- if (selectedServicetype !== "" && selectedServicetype !== 'undefined') {
- $location.path(COMPONENT.CREATE_INSTANCE_PATH);
- }
- };
-
- $scope.serviceTypeName="";
- $scope.getAaiServiceModelsList = function(){
- var globalCustomerId="";
- var serviceTypeId = DataService.getGlobalCustomerId();
- $scope.serviceTypeList = DataService.getServiceIdList();
- $scope.createSubscriberName = DataService.getSubscriberName();
- $scope.status = FIELD.STATUS.FETCHING_SERVICE_CATALOG;
- $scope.custSubList = DataService.getSubscribers();
- for(var i=0; i<$scope.serviceTypeList.length;i++){
- if(parseInt(serviceTypeId) === i ){
- $scope.serviceTypeName = $scope.serviceTypeList[i].name;
+ if (selectedServicetype !== "" && selectedServicetype !== 'undefined'&& selectedServicetype !== undefined) {
+ $location.path(COMPONENT.CREATE_INSTANCE_PATH);
+ }
+ };
+
+ $scope.serviceTypeName = "";
+ $scope.getAaiServiceModelsList = function () {
+ var globalCustomerId = "";
+ var serviceTypeId = DataService.getGlobalCustomerId();
+ $scope.serviceTypeList = DataService.getServiceIdList();
+ $scope.createSubscriberName = DataService.getSubscriberName();
+ $scope.status = FIELD.STATUS.FETCHING_SERVICE_CATALOG;
+ $scope.custSubList = DataService.getSubscribers();
+ for (var i = 0; i < $scope.serviceTypeList.length; i++) {
+ if (parseInt(serviceTypeId) === i) {
+ $scope.serviceTypeName = $scope.serviceTypeList[i].name;
+ }
+ }
+ ;
+ for (var i = 0; i < $scope.custSubList.length; i++) {
+ if ($scope.createSubscriberName === $scope.custSubList[i].subscriberName) {
+ globalCustomerId = $scope.custSubList[i].globalCustomerId;
+ globalCustId = globalCustomerId;
+ }
+ }
+ ;
+ var pathQuery = "";
+
+ if (null !== globalCustomerId && "" !== globalCustomerId && undefined !== globalCustomerId
+ && null !== serviceTypeId && "" !== serviceTypeId && undefined !== serviceTypeId) {
+ pathQuery = COMPONENT.SERVICES_PATH + globalCustomerId + "/" + $scope.serviceTypeName;
+ }
+
+ var namedQueryId = '6e806bc2-8f9b-4534-bb68-be91267ff6c8';
+ AaiService.getServiceModelsByServiceType(namedQueryId, globalCustomerId, $scope.serviceTypeName, function (response) { // success
+ $scope.services = [];
+ if (angular.isArray(response.data['inventory-response-item']) && response.data['inventory-response-item'].length > 0 && response.data['inventory-response-item'][0]['inventory-response-items']) {
+ wholeData = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'];
+ $scope.services = $scope.filterDataWithHigerVersion(response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item']);
+ $scope.serviceType = response.data['inventory-response-item'][0]['service-subscription']['service-type'];
+ $scope.viewPerPage = 10;
+ $scope.totalPage = $scope.services.length / $scope.viewPerPage;
+ $scope.sortBy = "name";
+ $scope.scrollViewPerPage = 2;
+ $scope.currentPage = 1;
+ $scope.searchCategory;
+ $scope.searchString = "";
+ $scope.currentPageNum = 1;
+ $scope.isSpinnerVisible = false;
+ $scope.isProgressVisible = false;
+ } else {
+ $scope.status = "Failed to get service models from ASDC.";
+ $scope.error = true;
+ $scope.isSpinnerVisible = false;
}
- }
- ;
- for(var i=0; i<$scope.custSubList.length;i++){
- if($scope.createSubscriberName === $scope.custSubList[i].subscriberName){
- globalCustomerId = $scope.custSubList[i].globalCustomerId;
- globalCustId = globalCustomerId;
- }
- }
- ;
- var pathQuery ="";
-
- if(null !== globalCustomerId && "" !== globalCustomerId && undefined !== globalCustomerId
- && null !== serviceTypeId && "" !== serviceTypeId && undefined !== serviceTypeId){
- pathQuery = COMPONENT.SERVICES_PATH +globalCustomerId+"/"+$scope.serviceTypeName;
- }
-
- var namedQueryId='6e806bc2-8f9b-4534-bb68-be91267ff6c8';
- AaiService.getServiceModelsByServiceType(namedQueryId,globalCustomerId,$scope.serviceTypeName,function(response) { // success
- $scope.services = [];
- if (angular.isArray(response.data['inventory-response-item']) && response.data['inventory-response-item'].length > 0 && response.data['inventory-response-item'][0]['inventory-response-items']) {
- wholeData = response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item'];
- $scope.services = $scope.filterDataWithHigerVersion(response.data['inventory-response-item'][0]['inventory-response-items']['inventory-response-item']);
- $scope.serviceType = response.data['inventory-response-item'][0]['service-subscription']['service-type'];
- $scope.viewPerPage=10;
- $scope.totalPage=$scope.services.length/$scope.viewPerPage;
- $scope.sortBy="name";
- $scope.scrollViewPerPage=2;
- $scope.currentPage=1;
- $scope.searchCategory;
- $scope.searchString="";
- $scope.currentPageNum=1;
- $scope.isSpinnerVisible = false;
- $scope.isProgressVisible = false;
- } else {
- $scope.status = "Failed to get service models from A&AI.";
- $scope.error = true;
- $scope.isSpinnerVisible = false;
- }
- DataService.setServiceIdList(response);
- }, function(response) { // failure
- $scope.showError(FIELD.ERROR.AAI);
- $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES+ response.status;
- $scope.errorDetails = response.data;
- });
-
- };
-
- var globalCustId;// This value will be assigned only on create new service instance screen-macro
- $scope.createType = "a la carte";
- $scope.deployService = function(service,hideServiceFields) {
- hideServiceFields = hideServiceFields|| false;
- var temp = service;
- service.uuid = service['service-instance']['model-version-id'];
-
- console.log("Instantiating ASDC service " + service.uuid);
-
- $http.get('rest/models/services/' + service.uuid)
- .then(function successCallback(getServiceResponse) {
- getServiceResponse.data['service'].serviceTypeName =$scope.serviceTypeName ;
- getServiceResponse.data['service'].createSubscriberName =$scope.createSubscriberName ;
- var serviceModel = getServiceResponse.data;
- DataService.setServiceName(serviceModel.service.name);
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": serviceModel.service.invariantUuid,
- "modelVersion": serviceModel.service.version,
- "modelNameVersionId": serviceModel.service.uuid,
- "modelName": serviceModel.service.name,
- "description": serviceModel.service.description,"serviceType": serviceModel.service.serviceType,
+ DataService.setServiceIdList(response);
+ }, function (response) { // failure
+ $scope.showError(FIELD.ERROR.AAI);
+ $scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES + response.status;
+ $scope.errorDetails = response.data;
+ });
+
+ };
+
+ var globalCustId;// This value will be assigned only on create new service instance screen-macro
+ $scope.createType = "a la carte";
+ $scope.deployService = function (service, hideServiceFields) {
+ hideServiceFields = hideServiceFields || false;
+ var temp = service;
+ service.uuid = service['service-instance']['model-version-id'];
+
+ console.log("Instantiating ASDC service " + service.uuid);
+
+ $http.get('rest/models/services/' + service.uuid)
+ .then(function successCallback(getServiceResponse) {
+ getServiceResponse.data['service'].serviceTypeName = $scope.serviceTypeName;
+ getServiceResponse.data['service'].createSubscriberName = $scope.createSubscriberName;
+ var serviceModel = getServiceResponse.data;
+ DataService.setServiceName(serviceModel.service.name);
+
+ DataService.setModelInfo(COMPONENT.SERVICE, {
+ "modelInvariantId": serviceModel.service.invariantUuid,
+ "modelVersion": serviceModel.service.version,
+ "modelNameVersionId": serviceModel.service.uuid,
+ "modelName": serviceModel.service.name,
+ "description": serviceModel.service.description,
+ "serviceType": serviceModel.service.serviceType,
"serviceRole": serviceModel.service.serviceRole,
- "category":serviceModel.service.category,
- "serviceTypeName":serviceModel.service.serviceTypeName,
- "createSubscriberName":serviceModel.service.createSubscriberName
- });
- DataService.setHideServiceFields(hideServiceFields);
- if(hideServiceFields){
- DataService.setServiceType($scope.serviceTypeName);
- DataService.setGlobalCustomerId(globalCustId);
- }
-
- DataService.setALaCarte (true);
- $scope.createType = "a la carte";
- var broadcastType = "createComponent";
-
- if (UtilityService.arrayContains (VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid )) {
- DataService.setALaCarte (false);
- $scope.createType = "Macro";
- var convertedAsdcModel = UtilityService.convertModel(serviceModel);
-
- //console.log ("display inputs ");
- //console.log (JSON.stringify ( convertedAsdcModel.completeDisplayInputs));
-
- DataService.setModelInfo(COMPONENT.SERVICE, {
- "modelInvariantId": serviceModel.service.invariantUuid,
- "modelVersion": serviceModel.service.version,
- "modelNameVersionId": serviceModel.service.uuid,
- "modelName": serviceModel.service.name,
- "description": serviceModel.service.description,
- "category":serviceModel.service.category,
- "serviceEcompNaming": serviceModel.service.serviceEcompNaming,
- "inputs": serviceModel.service.inputs,
- "displayInputs": convertedAsdcModel.completeDisplayInputs,
- "serviceTypeName":serviceModel.service.serviceTypeName,
- "createSubscriberName":serviceModel.service.createSubscriberName,
- "serviceType": serviceModel.service.serviceType,
+ "category": serviceModel.service.category,
+ "serviceTypeName": serviceModel.service.serviceTypeName,
+ "createSubscriberName": serviceModel.service.createSubscriberName
+ });
+ DataService.setHideServiceFields(hideServiceFields);
+ if (hideServiceFields) {
+ DataService.setServiceType($scope.serviceTypeName);
+ DataService.setGlobalCustomerId(globalCustId);
+ }
+
+ DataService.setALaCarte(true);
+ $scope.createType = "a la carte";
+ var broadcastType = "createComponent";
+
+ if (UtilityService.arrayContains(VIDCONFIGURATION.MACRO_SERVICES, serviceModel.service.invariantUuid)) {
+ DataService.setALaCarte(false);
+ $scope.createType = "Macro";
+ var convertedAsdcModel = UtilityService.convertModel(serviceModel);
+
+ //console.log ("display inputs ");
+ //console.log (JSON.stringify ( convertedAsdcModel.completeDisplayInputs));
+
+ DataService.setModelInfo(COMPONENT.SERVICE, {
+ "modelInvariantId": serviceModel.service.invariantUuid,
+ "modelVersion": serviceModel.service.version,
+ "modelNameVersionId": serviceModel.service.uuid,
+ "modelName": serviceModel.service.name,
+ "description": serviceModel.service.description,
+ "category": serviceModel.service.category,
+ "serviceEcompNaming": serviceModel.service.serviceEcompNaming,
+ "inputs": serviceModel.service.inputs,
+ "displayInputs": convertedAsdcModel.completeDisplayInputs,
+ "serviceTypeName": serviceModel.service.serviceTypeName,
+ "createSubscriberName": serviceModel.service.createSubscriberName,
+ "serviceType": serviceModel.service.serviceType,
"serviceRole": serviceModel.service.serviceRole
- });}
- ;
-
- $scope.$broadcast(broadcastType, {
- componentId : COMPONENT.SERVICE,
- callbackFunction : function(response) {
- if (response.isSuccessful) {
- vidService.setModel(serviceModel);
-
- var subscriberId = "Not Found";
- var serviceType = "Not Found";
-
- var serviceInstanceId = response.instanceId;
-
- for (var i = 0; i < response.control.length; i++) {
- if (response.control[i].id == "subscriberName") {
- subscriberId = response.control[i].value;
- } else if (response.control[i].id == "serviceType") {
- serviceType = response.control[i].value;
- }
- }
-
-
- $scope.refreshSubs(subscriberId,serviceType,serviceInstanceId);
-
- }
- }
- });
-
- }, function errorCallback(response) {
- console.log("Error: " + response);
- });
- };
- $scope.isFiltered=function(arr,obj){
- var filtered = false;
- if(arr.length>0){
- for(var i=0;i<arr.length;i++){
- if(obj['extra-properties']['extra-property'] && (obj['extra-properties']['extra-property'][2]['property-value'] == arr[i]['extra-properties']['extra-property'][2]['property-value'])
- && (obj['extra-properties']['extra-property'][4]['property-value'] == arr[i]['extra-properties']['extra-property'][4]['property-value'])){
- filtered = true;
- }
- }
- }
- return filtered;
- }
- var wholeData=[];
- $scope.filterDataWithHigerVersion = function(serviceData){
- var fiterDataServices = [];
- for(var i=0;i<serviceData.length;i++){
- var higherVersion = serviceData[i];
- if(!$scope.isFiltered(fiterDataServices,serviceData[i])){
- for(var j=i;j<serviceData.length;j++){
- if(serviceData[i]['extra-properties']['extra-property'] && serviceData[j]['extra-properties']['extra-property'] && (serviceData[i]['extra-properties']['extra-property'][4]['property-value'] == serviceData[j]['extra-properties']['extra-property'][4]['property-value'])
- && (serviceData[i]['extra-properties']['extra-property'][2]['property-value'] == serviceData[j]['extra-properties']['extra-property'][2]['property-value'])
- && (parseFloat(serviceData[j]['extra-properties']['extra-property'][6]['property-value'])>=parseFloat(serviceData[i]['extra-properties']['extra-property'][6]['property-value']))){
- var data = $scope.isThisHigher(fiterDataServices,serviceData[j]);
- if(data.isHigher){
- fiterDataServices[data.index] = serviceData[j];
- }
- }
- }
- }
- }
- return fiterDataServices;
- }
-
- $scope.isThisHigher = function(arr,obj){
- var returnObj = {
- isHigher:false,
- index:0
- };
- if(arr.length>0){
- var isNotMatched = true;
- for(var i=0;i<arr.length;i++){
- if(arr[i]['extra-properties']['extra-property'] && (arr[i]['extra-properties']['extra-property'][2]['property-value'] == obj['extra-properties']['extra-property'][2]['property-value'])
- && (arr[i]['extra-properties']['extra-property'][4]['property-value'] == obj['extra-properties']['extra-property'][4]['property-value'] )
- && (arr[i]['extra-properties']['extra-property'][6]['property-value'] < obj['extra-properties']['extra-property'][6]['property-value']) ){
- isNotMatched = false;
- returnObj = {
- isHigher:true,
- index:i
- };
- }
- }
- if(isNotMatched && !$scope.isFiltered(arr,obj)){
- returnObj = {
- isHigher:true,
- index:arr.length
- };
- }
- }else{
- returnObj = {
- isHigher:true,
- index:0
- }
- }
- return returnObj;
- }
-
- $scope.tableData=[];
- var oldData=[];
- $scope.loadPreviousVersionData=function(version,invariantUUID){
- $scope.tableData =[];
- oldData=[];
- for(var i=0;i<wholeData.length;i++){
- if(wholeData[i]['extra-properties']['extra-property'] && wholeData[i]['extra-properties']['extra-property'][4]['property-value'] == invariantUUID && version!=wholeData[i]['extra-properties']['extra-property'][6]['property-value']){
- oldData.push(wholeData[i]);
- }
- }
- $scope.tableData = oldData;
- $scope.createType = "Previous Version";
- var broadcastType = "createTableComponent";
- $scope.componentName = invariantUUID;
- $scope.$broadcast(broadcastType, {
- componentId : COMPONENT.OLDVERSION,
- callbackFunction : function(response) {
- }
- });
- }
- $scope.cancelCreateSIType = function(){
-
- window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;
-
- }
+ });
+ }
+ ;
+
+ $scope.$broadcast(broadcastType, {
+ componentId: COMPONENT.SERVICE,
+ callbackFunction: function (response) {
+ if (response.isSuccessful) {
+ vidService.setModel(serviceModel);
+
+ var subscriberId = "Not Found";
+ var serviceType = "Not Found";
+
+ var serviceInstanceId = response.instanceId;
+
+ for (var i = 0; i < response.control.length; i++) {
+ if (response.control[i].id == "subscriberName") {
+ subscriberId = response.control[i].value;
+ } else if (response.control[i].id == "serviceType") {
+ serviceType = response.control[i].value;
+ }
+ }
+
+
+ $scope.refreshSubs(subscriberId, serviceType, serviceInstanceId);
+
+ }
+ }
+ });
+
+ }, function errorCallback(response) {
+ $log.error("Error: ", response);
+ });
+ };
+
+ var wholeData=[];
+ //extract all models from service instances properties and filter by the higher model version
+ $scope.filterDataWithHigerVersion = function(serviceData){
+
+ //get all service instances & models collected into array. key = model invariant id
+ var servicesByModelInvariant = _.reduce(serviceData, function(result, item) {
+ if (item['extra-properties']['extra-property']) {
+ var invariantId = item['extra-properties']['extra-property'][4];
+ if (invariantId) {
+ (result[invariantId["property-value"]] || (result[invariantId["property-value"]] = [])).push(item);
+ }
+ }
+ return result;
+ }, {});
+
+ //iterate over the array and get the highest model version for each group of services
+ var filterDataServicesByVersion = [];
+ _.forEach(servicesByModelInvariant, function(items) {
+ var maxVersionItem = _.maxBy(items, function(item) { return parseFloat(item['extra-properties']['extra-property'][6]["property-value"]); });
+ filterDataServicesByVersion.push(maxVersionItem);
+ });
+
+ return filterDataServicesByVersion;
+ };
+
+ $scope.tableData = [];
+ var oldData = [];
+ $scope.loadPreviousVersionData = function (version, invariantUUID) {
+ $scope.tableData = [];
+ oldData = [];
+ for (var i = 0; i < wholeData.length; i++) {
+ if (wholeData[i]['extra-properties']['extra-property'] && wholeData[i]['extra-properties']['extra-property'][4]['property-value'] == invariantUUID && version != wholeData[i]['extra-properties']['extra-property'][6]['property-value']) {
+ oldData.push(wholeData[i]);
+ }
+ }
+ $scope.tableData = oldData;
+ $scope.createType = "Previous Version";
+ var broadcastType = "createTableComponent";
+ $scope.componentName = invariantUUID;
+ $scope.$broadcast(broadcastType, {
+ componentId: COMPONENT.OLDVERSION,
+ callbackFunction: function (response) {
+ }
+ });
+ }
+ $scope.cancelCreateSIType = function () {
+
+ window.location.href = COMPONENT.SERVICE_MODLES_INSTANCES_SUBSCRIBERS_PATH;
+
+ }
$scope.fetchServices = function () {
var serviceIdList = [];
@@ -379,7 +341,7 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
$scope.errorMsg = FIELD.ERROR.FETCHING_SERVICES + response.status;
$scope.errorDetails = response.data;
});
- }
+ };
$scope.refreshSubs = function () {
$scope.init();
@@ -387,10 +349,20 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
$scope.fetchServices();
};
+ $scope.loadOwningEntity = function () {
+ OwningEntityService.getOwningEntityProperties(function (response) {
+ $scope.owningEntities = response.owningEntity;
+ $scope.projects = response.project;
+
+ // working project name: owning-entity-id-val-cp8128
+ // working owning entity name: owning-entity-id-val-cp8128
+ });
+ };
+
$scope.fetchSubs = function (status) {
$scope.status = status;
- AaiService.getSubList(function (response) { // sucesss
+ AaiService.getSubList(function (response) {
$scope.setProgress(100); // done
$scope.status = FIELD.STATUS.DONE;
$scope.isSpinnerVisible = false;
@@ -408,16 +380,23 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
}
- $scope.getSubDetails = function (request) {
+ $scope.getSubDetails = function () {
$scope.init();
- $scope.selectedSubscriber = $location.search().selectedSubscriber;
- $scope.selectedServiceInstance = $location.search().selectedServiceInstance;
+ //$scope.selectedSubscriber = $location.search().selectedSubscriber;
+ // $scope.selectedServiceInstance = $location.search().selectedServiceInstance;
$scope.status = FIELD.STATUS.FETCHING_SUB_DETAILS + $scope.selectedSubscriber;
+ var query = $location.url().replace($location.path(),'');
$scope.displayData = [];
- AaiService.getSubDetails($scope.selectedSubscriber, $scope.selectedServiceInstance, function (displayData, subscriberName) {
- $scope.displayData = displayData;
+ AaiService.searchServiceInstances(query).then(function (response) {
+ $scope.displayData = response.displayData;
+ if (response.displayData.length)
+ {
+ var first = response.displayData[0];
+ $scope.selectedSubscriberId = first.globalCustomerId;
+ $scope.selectedSubscriberName = first.subscriberName;
+ }
$scope.viewPerPage = 10;
$scope.totalPage = $scope.displayData.length / $scope.viewPerPage;
$scope.scrollViewPerPage = 2;
@@ -429,13 +408,13 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
$scope.setProgress(100); // done
$scope.status = FIELD.STATUS.DONE;
$scope.isSpinnerVisible = false;
- $scope.subscriberName = subscriberName;
- }, function (response) {
+
+ }).catch(function (response) {
$scope.showError(FIELD.ERROR.AAI);
$scope.errorMsg = FIELD.ERROR.AAI_FETCHING_CUST_DATA + response.status;
$scope.errorDetails = response.data;
});
- }
+ };
$scope.$on(COMPONENT.MSO_DELETE_REQ, function (event, request) {
@@ -452,7 +431,6 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
});
$scope.init = function () {
-
//PropertyService.setAaiBaseUrl("testaai");
//PropertyService.setAsdcBaseUrl("testasdc");
@@ -529,37 +507,67 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
alert(response.statusText);
}
- $scope.getAsdcModel = function (disData) {
+ function getModelVersionIdForServiceInstance(instance) {
+ if (UtilityService.hasContents(instance.aaiModelVersionId)) {
+ return $q.resolve(instance.aaiModelVersionId);
+ } else {
+ return AaiService.getModelVersionId(instance.globalCustomerId, instance.serviceInstanceId);
+ }
+ }
- console.log("disData");
- console.log(JSON.stringify(disData, null, 4));
+ $scope.onViewEditClick = function (disData) {
+ $log.debug("disData", disData, null, 4);
- // if ( !(UtilityService.hasContents (disData.aaiModelVersionId)) ) {
- // $scope.errorMsg = FIELD.ERROR.MODEL_VERSION_ID_MISSING;
- // alert($scope.errorMsg);
- // return;
- // }
+ getModelVersionIdForServiceInstance(disData)
+ .then(getAsdcModelByVersionId, handleErrorGettingModelVersion)
+ .then(navigateToViewEditPage);
- // aaiModelVersionId is the model uuid
- var pathQuery = COMPONENT.SERVICES_PATH + disData.aaiModelVersionId;
- $http({
- method: 'GET',
- url: pathQuery
- }).then(function successCallback(response) {
- vidService.setModel(response.data);
+
+ function navigateToViewEditPage() {
window.location.href =
COMPONENT.INSTANTIATE_ROOT_PATH + disData.globalCustomerId +
COMPONENT.SUBSCRIBERNAME_SUB_PATH + disData.subscriberName +
COMPONENT.SERVICETYPE_SUB_PATH + disData.serviceType +
COMPONENT.SERVICEINSTANCEID_SUB_PATH + disData.serviceInstanceId +
COMPONENT.IS_PERMITTED_SUB_PATH + disData.isPermitted;
+ }
+ };
+
+ function handleErrorGettingModelVersion(err) {
+ $log.error("aaiSubscriber getModelVersionIdForServiceInstance - " + err);
+ $scope.errorMsg = err;
+ alert($scope.errorMsg);
+ return $q.reject();
+ }
+
+ function getAsdcModelByVersionId(aaiModelVersionId) {
+ // aaiModelVersionId is the model uuid
+ var pathQuery = COMPONENT.SERVICES_PATH + aaiModelVersionId;
+ return $http({
+ method: 'GET',
+ url: pathQuery
+ }).then(function successCallback(response) {
+ vidService.setModel(response.data);
console.log("aaiSubscriber getAsdcModel DONE!!!!");
}, function errorCallback(response) {
- console.log("aaiSubscriber getAsdcModel - No matching model found matching the A&AI model version ID = " + disData.aaiModelVersionId);
- $scope.errorMsg = FIELD.ERROR.NO_MATCHING_MODEL_AAI + disData.aaiModelVersionId;
+ $log.error("aaiSubscriber getAsdcModel - " + FIELD.ERROR.NO_MATCHING_MODEL_AAI + aaiModelVersionId);
+ $scope.errorMsg = FIELD.ERROR.NO_MATCHING_MODEL_AAI + aaiModelVersionId;
alert($scope.errorMsg);
});
+ }
+ function returnMatchingServiceSubscription(serviceSubs, serviceId){
+ var orchStatus;
+ serviceSubs.forEach(function(item){
+ if (item[FIELD.ID.SERVICE_INSTANCES] != null) {
+ item[FIELD.ID.SERVICE_INSTANCES][FIELD.ID.SERVICE_INSTANCE].forEach(function (service) {
+ if (service[FIELD.ID.SERVICE_INSTANCE_ID] === serviceId) {
+ orchStatus = service['orchestration-status']
+ }
+ })
+ }
+ });
+ return orchStatus;
}
$scope.getTenants = function (globalCustomerId) {
@@ -572,10 +580,26 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
});
}
+ $scope.isActivateDeactivateEnabled = function(btnType) {
+ if ($scope.serviceOrchestrationStatus && $scope.service.model.service.serviceType.toLowerCase().indexOf('transport') != -1) {
+ switch (btnType) {
+ case "activate":
+ return $scope.serviceOrchestrationStatus === 'Created' ||
+ $scope.serviceOrchestrationStatus.toLowerCase() === 'pendingdelete' || $scope.serviceOrchestrationStatus.toLowerCase() === 'pending-delete';
+ break;
+ case "deactivate":
+ return $scope.serviceOrchestrationStatus === 'Active';
+ break;
+ }
+ }
+
+ return false;
+ };
+
$scope.handleInitialResponseInventoryItems = function (response) {
$scope.inventoryResponseItemList = response.data[FIELD.ID.INVENTORY_RESPONSE_ITEM]; // get data from json
- console.log($scope.inventoryResponseItemList.toString());
+ $log.debug($scope.inventoryResponseItemList);
$scope.displayData = [];
$scope.vnfs = [];
@@ -585,8 +609,9 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
$scope.subscriberName = "";
// just look up the subscriber name in A&AI here...
AaiService.getSubscriberName($scope.globalCustomerId, function (response) {
- $scope.subscriberName = response;
+ $scope.subscriberName = response.subscriberName;
DataService.setSubscriberName($scope.subscriberName);
+ $scope.serviceOrchestrationStatus = returnMatchingServiceSubscription(response.serviceSubscriptions[FIELD.ID.SERVICE_SUBSCRIPTION], $scope.serviceInstanceId);
angular.forEach($scope.inventoryResponseItemList, function (inventoryResponseItem, key) {
@@ -609,12 +634,13 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
"type": PARAMETER.STRING,
"description": FIELD.PROMPT.VAR_DESCRIPTION_B,
"default": FIELD.PROMPT.DEFAULT_B
- },
+ }
},
"object": $scope.inventoryResponseItem[FIELD.ID.SERVICE_INSTANCE],
"vnfs": [],
- "networks": []
- }
+ "networks": [],
+ "configurations": []
+ };
if (inventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
@@ -760,6 +786,44 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
});
}
}
+
+ if (subInventoryResponseItem[FIELD.ID.GENERIC_CONFIGURATION] != null) {
+ var configObject = subInventoryResponseItem[FIELD.ID.GENERIC_CONFIGURATION];
+ var config = {
+ "id": $scope.counter++,
+ "name": configObject[FIELD.ID.CONFIGURATION_NAME],
+ "itemType": FIELD.ID.CONFIGURATION,
+ "nodeId": configObject[FIELD.ID.CONFIGURATION_ID],
+ "nodeType": configObject[FIELD.ID.CONFIGURATION_TYPE],
+ "nodeStatus": configObject[FIELD.ID.ORCHESTRATION_STATUS],
+ "modelInvariantId": configObject[FIELD.ID.MODEL_INVAR_ID],
+ "modelVersionId": configObject[FIELD.ID.MODEL_VERSION_ID],
+ "modelCustomizationId": configObject[FIELD.ID.MODEL_CUSTOMIZATION_ID],
+ "object": configObject,
+ "ports": []
+ };
+
+ $scope.allowConfigurationActions = [FIELD.STATUS.AAI_ACTIVE, FIELD.STATUS.AAI_INACTIVE, FIELD.STATUS.AAI_CREATED].indexOf(config.nodeStatus) != -1;
+
+ if (subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS] != null) {
+ angular.forEach(subInventoryResponseItem[FIELD.ID.INVENTORY_RESPONSE_ITEMS][FIELD.ID.INVENTORY_RESPONSE_ITEM], function (subSubInventoryResponseItem, key) {
+ var port = {};
+ var portObject;
+ if (subSubInventoryResponseItem[FIELD.ID.PORT] != null) {
+ portObject = subSubInventoryResponseItem[FIELD.ID.PORT];
+ port = {
+ "portId": portObject[FIELD.ID.PORT_ID],
+ "portName": portObject[FIELD.ID.PORT_NAME],
+ "portStatus": portObject[FIELD.ID.PORT_MIRRORED] === true ? FIELD.STATUS.AAI_ENABLED : FIELD.ID.AAI_DISABLED,
+ "object": portObject
+ };
+ config.ports.push(port);
+ }
+ });
+ }
+ $scope.service.instance[FIELD.ID.CONFIGURATIONS].push(config);
+ }
+
});
}
});
@@ -901,63 +965,239 @@ appDS2.controller("aaiSubscriberController", ["COMPONENT", "FIELD", "PARAMETER",
$scope.currentPage--;
}
- $scope.activateMSOInstance = function() {
- MsoService.activateInstance($scope.service.instance, $scope.service.model)
- .then(function(response) {
- alert("Activation succeeded");
- })
- .catch(function (error) {
- $log.error(error);
+ var getAicZoneAndSendToMso = function (msoType, requestParams) {
+ AaiService.getAicZoneForPNF(
+ $scope.service.instance.globalCustomerId,
+ $scope.service.instance.serviceType,
+ $scope.service.instance.serviceInstanceId, function (aicZone) {
+
+ requestParams.aicZone = aicZone;
+
+ openMsoModal(msoType, requestParams);
});
- ;
+ };
+
+ var activateDeactivateServiceInstance = function(msoType) {
+ var requestParams = {
+ model: $scope.service.model,
+ instance: $scope.service.instance
+ };
+
+ if (DataService.getLoggedInUserId()) {
+ requestParams.userId = DataService.getLoggedInUserId();
+ getAicZoneAndSendToMso(msoType, requestParams)
+ } else {
+ AaiService.getLoggedInUserID(function (response) {
+ var userID = response.data;
+ DataService.setLoggedInUserId(userID);
+ requestParams.userId = userID;
+
+ getAicZoneAndSendToMso(msoType, requestParams);
+ });
+ }
+ };
+
+ $scope.activateMSOInstance = function() {
+
+ activateDeactivateServiceInstance(COMPONENT.MSO_ACTIVATE_SERVICE_REQ);
+ };
+
+ $scope.deactivateMSOInstance = function() {
+
+ activateDeactivateServiceInstance(COMPONENT.MSO_DEACTIVATE_SERVICE_REQ);
+ };
+
+ $scope.toggleConfigurationStatus = function (serviceObject, configuration) {
+
+
+ AaiService.getLoggedInUserID(function (response) {
+ DataService.setLoggedInUserId(response.data);
+ var requestParams = {
+ serviceModel: {
+ "modelType": "service",
+ "modelInvariantId": serviceObject.model.service.invariantUuid,
+ "modelVersionId": "uuid",
+ "modelName": serviceObject.model.service.name,
+ "modelVersion": serviceObject.model.service.version
+ },
+ configurationModel: {
+ "modelType": "configuration",
+ "modelInvariantId": configuration.modelInvariantId,
+ "modelVersionId": configuration.modelVersionId,
+ "modelCustomizationId": configuration.modelCustomizationId
+ },
+ serviceInstanceId: serviceObject.instance.serviceInstanceId,
+ configurationId: configuration.nodeId,
+ configStatus: configuration.nodeStatus,
+ userId: DataService.getLoggedInUserId()
+ };
+
+ openMsoModal(COMPONENT.MSO_CHANGE_CONFIG_STATUS_REQ, requestParams);
+ });
+
+ };
+
+ $scope.togglePortStatus = function(serviceObject, configuration, port) {
+
+ var requestParams = {
+ serviceInstanceId: serviceObject.instance.serviceInstanceId,
+ configurationId: configuration.nodeId,
+ portId: port.portId,
+ portStatus: port.portStatus,
+ serviceModel: {
+ "modelType": "service",
+ "modelInvariantId": serviceObject.model.service.invariantUuid,
+ "modelVersionId": "uuid",
+ "modelName": serviceObject.model.service.name,
+ "modelVersion": serviceObject.model.service.version
+ },
+ configurationModel: {
+ "modelType": "configuration",
+ "modelInvariantId": configuration.modelInvariantId,
+ "modelVersionId": configuration.modelVersionId,
+ "modelCustomizationId": configuration.modelCustomizationId
+ },
+ userId: DataService.getLoggedInUserId()
+ };
+
+ openMsoModal(COMPONENT.MSO_CHANGE_PORT_STATUS_REQ, requestParams);
+ };
+
+ $scope.dissociatePnf = function(pnfName) {
+
+ var jobInfo = {
+ status: "confirm",
+ message: "Are you sure you would like to dissociate " + pnfName + " from the service instance?"
+ };
+
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/alert-modal/alert-modal.html',
+ controller: 'alertModalController',
+ controllerAs: 'vm',
+ appendTo: angular.element("#pnfs-tree"),
+ resolve: {
+ jobInfo: function () {
+ return jobInfo;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (result) {
+ console.log("This is the result of the alert modal.", result);
+
+ if (result) {
+ var requestParams = {
+ pnf: pnfName,
+ serviceModelInfo: {
+ invariantUuid: $scope.service.model.service.invariantUuid,
+ uuid: $scope.service.model.service.uuid,
+ version: $scope.service.model.service.version,
+ name: $scope.service.model.service.name
+ },
+ serviceInstanceId: $scope.service.instance.serviceInstanceId
+ };
+
+ if (DataService.getLoggedInUserId()) {
+ requestParams.attuuid = DataService.getLoggedInUserId();
+ openMsoModal(COMPONENT.MSO_REMOVE_RELATIONSHIP, requestParams);
+ } else {
+ AaiService.getLoggedInUserID(function (response) {
+ DataService.setLoggedInUserId(response.data);
+
+ requestParams.attuuid = response.data;
+ openMsoModal(COMPONENT.MSO_REMOVE_RELATIONSHIP, requestParams);
+ });
+ }
+ }
+ });
+
+
+ };
+
+ var openMsoModal = function (msoType, requestParams) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+ controller : "msoCommitModalController",
+ backdrop: false,
+ resolve: {
+ msoType: function () {
+ return msoType;
+ },
+ requestParams: function() {
+ requestParams.callbackFunction = updateViewCallbackFunction;
+ return requestParams;
+ }
+ }
+ });
+ };
+
+ var updateViewCallbackFunction = function(response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color" : color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function() {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $scope.reloadRoute();
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color" : color
+ };
+ }, 500);
};
$scope.nextPage = function () {
$scope.currentPage++;
+ };
+
+ $scope.serviceInstanceses = [{"sinstance": FIELD.NAME.SERVICE_INSTANCE_Id}, {"sinstance": FIELD.NAME.SERVICE_INSTANCE_NAME}];
+
+ function navigateToSearchResultsPage(globalCustomerId, selectedServiceInstance, selectedProjects, selectedOwningEntities) {
+ var projectQuery = AaiService.getMultipleValueParamQueryString(_.map(selectedProjects, 'id'), COMPONENT.PROJECT_SUB_PATH);
+ var owningEntityQuery = AaiService.getMultipleValueParamQueryString(_.map(selectedOwningEntities, 'id'), COMPONENT.OWNING_ENTITY_SUB_PATH);
+ var globalCustomerIdQuery = globalCustomerId ? COMPONENT.SELECTED_SUBSCRIBER_SUB_PATH + globalCustomerId : null;
+ var serviceInstanceQuery = selectedServiceInstance ? COMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH + selectedServiceInstance : null;
+ var query = AaiService.getJoinedQueryString([projectQuery, owningEntityQuery, globalCustomerIdQuery, serviceInstanceQuery]);
+
+ window.location.href = COMPONENT.SELECTED_SERVICE_SUB_PATH + query;
}
- $scope.serviceInstanceses = [{"sinstance": FIELD.NAME.SERVICE_INSTANCE_Id}, {"sinstance": FIELD.NAME.SERVICE_INSTANCE_NAME}]
- $scope.getSubscriberDet = function (selectedCustomer, selectedserviceinstancetype, selectedServiceInstance) {
-
- var sintype = selectedserviceinstancetype;
- if (selectedServiceInstance != "" && selectedServiceInstance != undefined) {
- selectedServiceInstance.trim();
-
- // check with A&AI
- $http.get(COMPONENT.AAI_GET_SERVICE_INSTANCE_PATH + selectedServiceInstance + "/" + sintype + "?r=" + Math.random(), {}, {
- timeout: $scope.responseTimeoutMsec
- }).then(function (response) {
- var notFound = true;
- if (angular.isArray(response.data[FIELD.ID.RESULT_DATA])) {
- var item = [];
- var urlParts = [];
- item = response.data[FIELD.ID.RESULT_DATA][0];
- var url = item[FIELD.ID.RESOURCE_LINK];
- var globalCustomerId = "";
- var serviceSubscription = "";
- // split it and find the customer Id and service-subscription
- urlParts = url.split("/");
- if (urlParts[7] === FIELD.ID.CUSTOMER) {
- globalCustomerId = urlParts[8];
- }
- if (urlParts[10] === FIELD.ID.SERVICE_SUBSCRIPTION) {
- serviceSubscription = urlParts[11];
- }
- if (globalCustomerId !== "") {
- notFound = false;
- window.location.href = COMPONENT.SELECTED_SERVICE_SUB_PATH + serviceSubscription + COMPONENT.SELECTEDSUBSCRIBER_SUB_PATH + globalCustomerId + COMPONENT.SELECTEDSERVICEINSTANCE_SUB_PATH + selectedServiceInstance;
- }
+ $scope.getServiceInstancesSearchResults =
+ function (selectedCustomer, selectedInstanceIdentifierType, selectedServiceInstance, selectedProject, selectedOwningEntity) {
+ var isSelectionValid = UtilityService.hasContents(selectedCustomer) || UtilityService.hasContents(selectedProject)
+ || UtilityService.hasContents(selectedOwningEntity) || UtilityService.hasContents(selectedServiceInstance);
+
+ if (isSelectionValid) {
+ if (UtilityService.hasContents(selectedServiceInstance)) {
+ AaiService
+ .getGlobalCustomerIdByInstanceIdentifier(selectedServiceInstance, selectedInstanceIdentifierType)
+ .then(handleCustomerIdResponse);
+ } else {
+ navigateToSearchResultsPage(selectedCustomer, null, selectedProject, selectedOwningEntity);
}
- if (notFound) {
+ } else {
+ alert(FIELD.ERROR.SELECT);
+ }
+
+ function handleCustomerIdResponse(globalCustomerId) {
+ if (UtilityService.hasContents(globalCustomerId)) {
+ navigateToSearchResultsPage(globalCustomerId, selectedServiceInstance, selectedProject, selectedOwningEntity);
+ } else {
alert(FIELD.ERROR.SERVICE_INST_DNE);
}
- }); // add a failure callback...
- } else if (selectedCustomer != null) {
- window.location.href = COMPONENT.SELECTED_SUB_PATH + selectedCustomer;
- } else {
- alert(FIELD.ERROR.SELECT);
- }
- };
+ }
+ };
}]).directive('restrictInput', function () {
return {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
index 662b10ecd..273f13017 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/change-management.controller.js
@@ -1,12 +1,15 @@
(function () {
'use strict';
- appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log", changeManagementController]);
+ appDS2.controller("changeManagementController", ["$uibModal", "changeManagementService", "_", "$log", "SchedulerService", "$filter", changeManagementController]);
- function changeManagementController($uibModal, changeManagementService, _, $log) {
+ function changeManagementController($uibModal, changeManagementService, _, $log, SchedulerService, $filter) {
var vm = this;
- var init = function() {
+ vm.lastTimeUpdated = "";
+
+ vm.init = function() {
+ vm.lastTimeUpdated = $filter('date')(new Date(), "MM/dd/yyyy | HH:mm:ss");
loadMSOChangeManagements();
loadSchedulerChangeManagements();
};
@@ -26,16 +29,16 @@
.then(function(response) {
vm.pendingChangeManagements = response.data;
_.forEach(vm.pendingChangeManagements, function(changeManagement) {
- var callbackData = _.filter(changeManagement.scheduleRequest.domainData, {name: "CallbackData"});
+ var callbackData = _.filter(changeManagement.scheduleRequest.domainData, {name: "WorkflowName"});
if(callbackData) {
var parsedModel = {};
try {
- parsedModel = JSON.parse(callbackData[0].value);
+ parsedModel = callbackData[0].value;
} catch(exception) {
$log.error(exception);
}
- changeManagement.workflow = parsedModel.requestType || 'No workflow';
+ changeManagement.workflow = parsedModel;
}
});
})
@@ -57,10 +60,6 @@
});
};
- vm.openScheduler = function() {
- console.log("function for opening the scheduler app")
- };
-
vm.searchChanges = function() {
console.log("function for searching changes: " + vm.searchChangesTerm)
};
@@ -74,7 +73,8 @@
jobInfo: function () {
return jobInfo;
}
- }
+ },
+
});
modalInstance.result.then(function (result) {
@@ -115,12 +115,12 @@
console.log("This is the result of the alert change management modal.", result);
});
};
-
- vm.openPendingModal = function(jobInfo) {
+ vm.openBasicAlertModal = function(jobInfo) {
var modalInstance = $uibModal.open({
- templateUrl: 'app/vid/scripts/modals/pending-change-management/pending-change-management.html',
- controller: 'changeManagementManualTasksController',
+ templateUrl: 'app/vid/scripts/modals/alert-modal/alert-modal.html',
+ controller: 'alertModalController',
controllerAs: 'vm',
+ appendTo: angular.element(".jobs-table").eq(0),
resolve: {
jobInfo: function () {
return jobInfo;
@@ -129,10 +129,51 @@
});
modalInstance.result.then(function (result) {
- console.log("This is the result of the pending change management modal.", result);
+ console.log("This is the result of the alert change management modal.", result);
});
};
+ vm.openPendingModal = function($event, changeManagement) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html',
+ controller: 'cancelPendingWorkflowController',
+ controllerAs: 'vm',
+ backdrop: false,
+ animation: true,
+ appendTo: angular.element($event.currentTarget).parent(),
+ resolve: {
+ changeManagement: function () {
+ return changeManagement;
+ }
+ }
+ });
+
+ modalInstance.result.then(function (result) {
+ // send to service
+ if(result){
+ SchedulerService.cancelScheduleRequest(changeManagement.scheduleRequest.scheduleId,
+ function(response) {
+
+ //success popup
+ var jobInfo= {
+ status:"success",
+ message: "Cancel workflow "+changeManagement.scheduleRequest.scheduleName+" succeeded."};
+ vm.openBasicAlertModal(jobInfo);
+
+ return response;
+ }, function(error) {
+
+ //failed popup
+ var jobInfo = {
+ status:"failed",
+ message: "Cancel workflow "+changeManagement.scheduleRequest.scheduleName+" failed due to an unexpected error."};
+ vm.openBasicAlertModal(jobInfo);
+
+ });
+ }});
+
+ };
+
- init();
+ vm.init();
}
})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
index 499a1ec02..9715484d4 100755..100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/deletionDialogController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/deleteResumeDialogController.js
@@ -1,123 +1,148 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-"use strict";
-
-var deletionDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log,
- DeletionService, UtilityService) {
-
- $scope.isDialogVisible = false;
- $scope.summaryControl = {};
- $scope.userProvidedControl = {};
-
- var callbackFunction = undefined;
- var componentId = undefined;
-
- $scope.$on(COMPONENT.DELETE_COMPONENT, function(event, request) {
-
- $scope.isDataVisible = false;
- $scope.isSpinnerVisible = false;
- $scope.isErrorVisible = false;
- $scope.isDialogVisible = true;
- $scope.popup.isVisible = true;
- $scope.isConfirmEnabled = false;
-
- callbackFunction = request.callbackFunction;
- componentId = request.componentId;
-
- DeletionService.initializeComponent(request.componentId);
-
- $scope.componentName = DeletionService.getComponentDisplayName();
-
- $scope.summaryControl.setList(DeletionService.getSummaryList());
-
- DeletionService.getParameters(handleGetParametersResponse);
-
- });
-
- var handleGetParametersResponse = function(parameters, dontshow) {
- $scope.summaryControl.setList(parameters.summaryList);
- $scope.userProvidedControl.setList(parameters.userProvidedList);
-
- $scope.isSpinnerVisible = false;
- if (dontshow)
- $scope.isDataVisible = false;
- else
- $scope.isDataVisible = true;
- $scope.isConfirmEnabled = true;
- };
-
- $scope.userParameterChanged = function(id) {
- DeletionService.updateUserParameterList(id, $scope.userProvidedControl);
- }
-
- $scope.confirm = function() {
-
- var requiredFields = $scope.userProvidedControl.getRequiredFields();
- if (requiredFields === "") {
- $scope.isErrorVisible = false;
- } else {
- showError(FIELD.ERROR.MISSING_DATA, requiredFields);
- return;
- }
-
-
- var requestDetails = DeletionService.getMsoRequestDetails($scope.userProvidedControl.getList());
-
- if(DeletionService.isMacro === true){
- requestDetails.requestParameters.aLaCarte = false;
- }
-
- $scope.isDialogVisible = false;
-
- $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
- url : DeletionService.getMsoUrl(),
- requestDetails : requestDetails,
- componentId: componentId,
- callbackFunction : function(isSuccessful) {
- if (isSuccessful) {
- $scope.popup.isVisible = false;
- runCallback(true);
- } else {
- $scope.isDialogVisible = true;
- }
- }
- });
-
- }
-
- $scope.cancel = function() {
- $scope.isDialogVisible = false;
- $scope.popup.isVisible = false;
- runCallback(false);
- }
-
- var runCallback = function(isSuccessful) {
- if (angular.isFunction(callbackFunction)) {
- callbackFunction({
- isSuccessful : isSuccessful
- });
- }
- }
-}
-
-appDS2.controller("deletionDialogController", [ "COMPONENT", "FIELD", "$scope", "$http",
- "$timeout", "$log", "DeletionService", "UtilityService",
- deletionDialogController ]);
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var deleteResumeDialogController = function( COMPONENT, FIELD, $scope, $http, $timeout, $log,
+ DeleteResumeService, CreationService, UtilityService) {
+
+ $scope.isDialogVisible = false;
+ $scope.summaryControl = {};
+ $scope.userProvidedControl = {};
+
+ var callbackFunction = undefined;
+ var componentId = undefined;
+
+ $scope.$on(COMPONENT.DELETE_RESUME_COMPONENT, function(event, request) {
+
+ $scope.isDataVisible = false;
+ $scope.isSpinnerVisible = false;
+ $scope.isErrorVisible = false;
+ $scope.isDialogVisible = true;
+ $scope.popup.isVisible = true;
+ $scope.isConfirmEnabled = false;
+ $scope.dialogMethod = request.dialogMethod;
+ callbackFunction = request.callbackFunction;
+ componentId = request.componentId;
+
+ DeleteResumeService.initializeComponent(request.componentId);
+
+ $scope.componentName = DeleteResumeService.getComponentDisplayName();
+
+ $scope.summaryControl.setList(DeleteResumeService.getSummaryList());
+
+ DeleteResumeService.getParameters(handleGetParametersResponse);
+
+ });
+
+ var handleGetParametersResponse = function(parameters, dontshow) {
+ $scope.summaryControl.setList(parameters.summaryList);
+ $scope.userProvidedControl.setList(parameters.userProvidedList);
+
+ $scope.isSpinnerVisible = false;
+ if (dontshow)
+ $scope.isDataVisible = false;
+ else
+ $scope.isDataVisible = true;
+ $scope.isConfirmEnabled = true;
+ };
+
+ $scope.userParameterChanged = function(id) {
+ DeleteResumeService.updateUserParameterList(id, $scope.userProvidedControl);
+ }
+
+ $scope.confirm = function() {
+ var requiredFields = $scope.userProvidedControl.getRequiredFields();
+ if (requiredFields === "") {
+ $scope.isErrorVisible = false;
+ } else {
+ showError(FIELD.ERROR.MISSING_DATA, requiredFields);
+ return;
+ }
+
+
+
+ var callbackAfterMSO = function(isSuccessful) {
+ if (isSuccessful) {
+ $scope.popup.isVisible = false;
+ runCallback(true);
+ } else {
+ $scope.isDialogVisible = true;
+ }
+ };
+
+
+ $scope.isDialogVisible = false;
+
+ if ($scope.dialogMethod == COMPONENT.DELETE)
+ {
+
+ var requestDetails = DeleteResumeService.getMsoRequestDetails($scope.userProvidedControl.getList());
+
+ if(DeleteResumeService.isMacro === true){
+ requestDetails.requestParameters.aLaCarte = false;
+ }
+
+ $scope.$broadcast(COMPONENT.MSO_DELETE_REQ, {
+ url : DeleteResumeService.getMsoUrl(),
+ requestDetails : requestDetails,
+ componentId: componentId,
+ callbackFunction : callbackAfterMSO
+ });
+ }
+ else
+ if ($scope.dialogMethod == COMPONENT.RESUME)
+ {
+ CreationService.initializeComponent(componentId);
+ CreationService.setInventoryInfo();
+
+ var requestDetails = CreationService.getMsoRequestDetails($scope.userProvidedControl.getList());
+
+
+ $scope.$broadcast(COMPONENT.MSO_CREATE_REQ, {
+ url : CreationService.getMsoUrl(),
+ requestDetails : requestDetails,
+ componentId: componentId,
+ callbackFunction : callbackAfterMSO
+ });
+
+
+ }
+
+ }
+
+ $scope.cancel = function() {
+ $scope.isDialogVisible = false;
+ $scope.popup.isVisible = false;
+ runCallback(false);
+ }
+
+ var runCallback = function(isSuccessful) {
+ if (angular.isFunction(callbackFunction)) {
+ callbackFunction({
+ isSuccessful : isSuccessful
+ });
+ }
+ }
+}
+
+appDS2.controller("deleteResumeDialogController", [ "COMPONENT", "FIELD", "$scope", "$http",
+ "$timeout", "$log", "DeleteResumeService","CreationService", "UtilityService",
+ deleteResumeDialogController]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
index 65fac289a..dd3ba50f0 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitController.js
@@ -64,25 +64,42 @@
*/
var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $window, $log,
- MsoService, PropertyService, UtilityService, DataService) {
+ MsoService, PropertyService, UtilityService, TestEnvironmentsService) {
$scope.isViewVisible = false;
$scope.progressBarControl = {};
$scope.popupWindowControl = {};
-
+ var getRequestStatusFunc = getOrchestrationRequestStatus; //default
var _this = this;
$scope.$on("createInstance", function(event, request) {
- init(request, COMPONENT.MSO_CREATE_REQ );
+ init(request, COMPONENT.MSO_CREATE_REQ, getOrchestrationRequestStatus );
MsoService.createInstance(request, handleInitialResponse);
});
$scope.$on("deleteInstance", function(event, request) {
- init(request, COMPONENT.MSO_DELETE_REQ);
+ init(request, COMPONENT.MSO_DELETE_REQ, getOrchestrationRequestStatus);
MsoService.deleteInstance(request, handleInitialResponse);
});
- var init = function(request, msoRequestType ) {
+ $scope.$on(COMPONENT.MSO_CREATE_ENVIRONMENT, function(event, request) {
+ init(request, COMPONENT.MSO_CREATE_ENVIRONMENT, getCloudResourcesRequestStatus);
+ TestEnvironmentsService.createApplicationEnv(request).then(handleInitialResponse);
+ });
+
+ $scope.$on(COMPONENT.MSO_DEACTIVATE_ENVIRONMENT, function(event, request) {
+ init(request, COMPONENT.MSO_DEACTIVATE_ENVIRONMENT, getCloudResourcesRequestStatus);
+ TestEnvironmentsService.deactivateApplicationEnv(request).then(handleInitialResponse)
+ });
+
+ $scope.$on(COMPONENT.MSO_ACTIVATE_ENVIRONMENT, function(event, request) {
+ init(request, COMPONENT.MSO_ACTIVATE_ENVIRONMENT, getCloudResourcesRequestStatus);
+ TestEnvironmentsService.activateApplicationEnv(request).then(handleInitialResponse)
+ });
+
+
+ var init = function(request, msoRequestType, getStatusRequest ) {
+ getRequestStatusFunc = getStatusRequest;
$scope.status = FIELD.STATUS.SUBMITTING_REQUEST;
$scope.isSpinnerVisible = true;
$scope.isProgressVisible = true;
@@ -109,13 +126,13 @@ var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $w
showError(FIELD.ERROR.SYSTEM_FAILURE, UtilityService
.getHttpErrorMessage(response));
});
- }
+ };
var handleInitialResponse = function(response) {
try {
updateViewAfterInitialResponse(response);
- _this.timer = $timeout(getRequestStatus, PropertyService
+ _this.timer = $timeout(getRequestStatusFunc, PropertyService
.getMsoMaxPollingIntervalMsec());
$scope.instanceId = response.data.entity.instanceId;
@@ -133,11 +150,16 @@ var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $w
}
}
- var getRequestStatus = function() {
- MsoService.getOrchestrationRequest(_this.requestId, handleGetResponse);
+ function getOrchestrationRequestStatus() {
+ MsoService.getOrchestrationRequest(_this.requestId, handleGetStatusResponse);
}
- var handleGetResponse = function(response) {
+ function getCloudResourcesRequestStatus() {
+ TestEnvironmentsService.getRequestStatus(_this.requestId, handleGetStatusResponse);
+ }
+
+
+ var handleGetStatusResponse = function(response) {
try {
if (isUpdateViewAfterGetResponseComplete(response)) {
return;
@@ -147,7 +169,7 @@ var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $w
_this.isMsoError = true;
showError(FIELD.ERROR.MAX_POLLS_EXCEEDED);
} else {
- _this.timer = $timeout(getRequestStatus, PropertyService
+ _this.timer = $timeout(getRequestStatusFunc, PropertyService
.getMsoMaxPollingIntervalMsec());
}
} catch (error) {
@@ -296,5 +318,5 @@ var msoCommitController = function(COMPONENT, FIELD, $scope, $http, $timeout, $w
}
appDS2.controller("msoCommitController", [ "COMPONENT", "FIELD", "$scope", "$http", "$timeout",
- "$window", "$log", "MsoService", "PropertyService", "UtilityService",
+ "$window", "$log", "MsoService", "PropertyService", "UtilityService", "TestEnvironmentsService",
msoCommitController ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js
new file mode 100644
index 000000000..148b4ccec
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/msoCommitModalController.js
@@ -0,0 +1,237 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var msoCommitModalController = function(COMPONENT, FIELD, $scope, $http, $timeout, $window, $log,
+ MsoService, PropertyService, UtilityService, DataService, $uibModalInstance, msoType, requestParams, vidService) {
+
+ $scope.isSpinnerVisible = true;
+ $scope.isProgressVisible = true;
+ $scope.status = FIELD.STATUS.SUBMITTING_REQUEST;
+ $scope.error = "";
+ $scope.log = "";
+ $scope.progressBarControl = {};
+ $scope.isCloseEnabled = false;
+
+ var _this = this;
+ _this.pollAttempts = 0;
+ _this.callbackFunction = requestParams.callbackFunction;
+ _this.isMsoError = false;
+
+
+ if (angular.isFunction($scope.progressBarControl.reset)) {
+ $scope.progressBarControl.reset();
+ }
+ $scope.percentProgress = 2; // Show "a little" progress
+
+
+ /*
+ * Updates the view and returns "true" if the MSO operation has returned a
+ * "Complete" status.
+ */
+ var isUpdateViewAfterGetResponseComplete = function(response) {
+ //console.log("msoCommitController isUpdateViewAfterGetResponseComplete");
+ updateLogFinalResponse(response);
+
+ var requestStatus = UtilityService.checkUndefined(FIELD.ID.REQUEST_STATUS,
+ UtilityService.checkUndefined(FIELD.ID.REQUEST,
+ response.data.entity.request).requestStatus);
+
+ var requestState = requestStatus.requestState;
+ console.log("msoCommitController requestState=" + requestState);
+ // look for "progress" or "pending"
+ var patt1 = /progress/i;
+ var patt2 = /pending/i;
+ var result1 = patt1.test(requestState);
+ var result2 = patt2.test(requestState);
+ if (result1 || result2) {
+ requestState = FIELD.STATUS.IN_PROGRESS;
+ }
+ var statusMessage = requestStatus.statusMessage;
+ console.log("msoCommitController statusMessage=" + statusMessage);
+ if (UtilityService.hasContents(statusMessage)) {
+ $scope.status = requestState + " - " + statusMessage;
+ } else {
+ $scope.status = requestState;
+ }
+ if (UtilityService.hasContents(requestStatus.percentProgress)) {
+ $scope.percentProgress = requestStatus.percentProgress;
+ }
+
+ if ( (requestState.toLowerCase() === FIELD.STATUS.FAILED.toLowerCase()) || (requestState.toLowerCase() === FIELD.STATUS.UNLOCKED.toLowerCase())) {
+ throw {
+ type : FIELD.STATUS.MSO_FAILURE
+ };
+ }
+
+ if (requestState.toLowerCase() === FIELD.STATUS.COMPLETE.toLowerCase()) {
+ $scope.isSpinnerVisible = false;
+ return true;
+ }
+
+ return false;
+ };
+
+ var handleGetResponse = function(response) {
+ try {
+ if (isUpdateViewAfterGetResponseComplete(response)) {
+ return;
+ }
+ if (++_this.pollAttempts > PropertyService.getMsoMaxPolls()) {
+ _this.isMsoError = true;
+ showError(FIELD.ERROR.MAX_POLLS_EXCEEDED);
+ } else {
+ _this.timer = $timeout(getRequestStatus, PropertyService
+ .getMsoMaxPollingIntervalMsec());
+ }
+ } catch (error) {
+ _this.isMsoError = true;
+ MsoService.showResponseContentError(error, showError);
+ }
+ };
+
+ var showError = function(summary, details) {
+ var message = summary;
+ if (UtilityService.hasContents(details)) {
+ message += " (" + details + ")";
+ }
+ $scope.isSpinnerVisible = false;
+ $scope.isProgressVisible = false;
+ $scope.error = message;
+ $scope.status = FIELD.STATUS.ERROR;
+ };
+
+ var getRequestStatus = function() {
+ MsoService.getOrchestrationRequest(_this.requestId, handleGetResponse);
+ };
+
+ var updateLog = function(response) {
+ $scope.log = MsoService.getFormattedCommonResponse(response)
+ + $scope.log;
+ UtilityService.checkUndefined("entity", response.data.entity);
+ UtilityService.checkUndefined("status", response.data.status);
+ MsoService.checkValidStatus(response);
+ };
+
+ var updateLogFinalResponse = function(response) {
+ $scope.log = MsoService.getFormattedSingleGetOrchestrationRequestResponse(response)
+ + $scope.log;
+ UtilityService.checkUndefined("entity", response.data.entity);
+ UtilityService.checkUndefined("status", response.data.status);
+ MsoService.checkValidStatus(response);
+ };
+
+ var updateViewAfterInitialResponse = function(response) {
+ $scope.isCloseEnabled = true;
+ updateLog(response);
+
+ _this.requestId = UtilityService.checkUndefined(FIELD.ID.REQUEST_ID,
+ UtilityService.checkUndefined(FIELD.ID.REQUEST_REFERENCES,
+ response.data.entity.requestReferences).requestId);
+
+ $scope.percentProgress = 4; // Show "a little more" progress
+ $scope.status = FIELD.STATUS.IN_PROGRESS;
+ };
+
+ var init = function(msoType) {
+ switch(msoType) {
+ case COMPONENT.MSO_CREATE_REQ:
+ return MsoService.createConfigurationInstance(requestParams);
+ case COMPONENT.MSO_CHANGE_CONFIG_STATUS_REQ:
+ return MsoService.toggleConfigurationStatus(requestParams);
+ case COMPONENT.MSO_CHANGE_PORT_STATUS_REQ:
+ return MsoService.togglePortStatus(requestParams);
+ case COMPONENT.MSO_CREATE_REALATIONSHIP:
+ return MsoService.associatePnf(requestParams);
+ case COMPONENT.MSO_REMOVE_RELATIONSHIP:
+ return MsoService.dissociatePnf(requestParams);
+ case COMPONENT.MSO_ACTIVATE_SERVICE_REQ:
+ return MsoService.activateInstance(requestParams);
+ case COMPONENT.MSO_DEACTIVATE_SERVICE_REQ:
+ return MsoService.deactivateInstance(requestParams);
+ }
+ };
+
+ var successCallbackFunction = function(response) {
+ try {
+ updateViewAfterInitialResponse(response);
+ _this.timer = $timeout(getRequestStatus, PropertyService
+ .getMsoMaxPollingIntervalMsec());
+
+ $scope.instanceId = response.data.entity.instanceId;
+ if ($scope.instanceId == null) {
+ $scope.instanceId = response.data.entity.requestReferences.instanceId;
+ }
+ } catch (error) {
+ if ( response.data != null && response.data.status != null ) {
+ if (response.data.status > 299 || response.data.status < 200 ) {
+ // MSO returned an error
+ _this.isMsoError = true;
+ }
+ }
+ MsoService.showResponseContentError(error, showError);
+ }
+ };
+
+ var errorCallbackFunction = function (error) {
+ UtilityService.setHttpErrorHandler(function(error) {
+ $scope.isCloseEnabled = true;
+ _this.isMsoError = true;
+ showError(FIELD.ERROR.SYSTEM_FAILURE, UtilityService
+ .getHttpErrorMessage(error));
+ });
+ };
+
+ $scope.close = function() {
+ $uibModalInstance.dismiss('cancel');
+
+ if (_this.timer !== undefined) {
+ $timeout.cancel(_this.timer);
+ }
+
+ if (angular.isFunction(_this.callbackFunction)) {
+ if ($scope.error === "") {
+ _this.callbackFunction({
+ isSuccessful : true,
+ instanceId : $scope.instanceId
+ });
+ } else {
+ _this.callbackFunction({
+ isSuccessful : false
+ });
+ }
+ }
+ };
+
+ _this.msoRequestType = msoType;
+
+ init(_this.msoRequestType)
+ .then(function (response) {
+ successCallbackFunction(response);
+ })
+ .catch(function (error) {
+ errorCallbackFunction(error);
+ });
+};
+
+appDS2.controller("msoCommitModalController", [ "COMPONENT", "FIELD", "$scope", "$http", "$timeout",
+ "$window", "$log", "MsoService", "PropertyService", "UtilityService", "DataService", "$uibModalInstance", "msoType", "requestParams", "vidService",
+ msoCommitModalController ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js
new file mode 100644
index 000000000..22a20abf8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/pnfSearchAssociationController.js
@@ -0,0 +1,138 @@
+/*-
+* ============LICENSE_START=======================================================
+* VID
+* ================================================================================
+* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+* ================================================================================
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+* ============LICENSE_END=========================================================
+*/
+
+/**
+ * The Instantiation (or View/Edit) Controller controls the instantiation/removal of
+ * deployable objects (Services, VNFs, VF-Modules, Networks, and Volume-Groups)
+ */
+
+"use strict";
+
+appDS2.controller("pnfSearchAssociationController", ["COMPONENT", "$log", "FIELD", "PARAMETER", "DataService", "CreationService", "$scope", "$window", "$location", "AaiService", "$uibModal", "UtilityService", "vidService", "$timeout",
+ function (COMPONENT, $log, FIELD, PARAMETER, DataService, CreationService, $scope, $window, $location, AaiService, $uibModal, UtilityService, vidService, $timeout) {
+
+ var requestParams = {};
+
+ $scope.selectedMetadata = {};
+
+ $scope.serviceMetadataFields = [];
+ $scope.nodeTemplateFields = {};
+
+ $scope.pnfInstance= false;
+ $scope.notFound= false;
+
+ $scope.pnfMetadata = [];
+
+ $scope.errorMsg = FIELD.ERROR.INSTANCE_NAME_VALIDATE;
+
+ $scope.modelName = DataService.getModelInfo(COMPONENT.VNF).modelCustomizationName;
+
+ var handleGetParametersResponse = function(parameters) {
+ $scope.serviceMetadataFields = parameters.summaryList;
+ $scope.serviceMetadataFields.forEach(function (t, number) {
+ $scope.serviceMetadataFields[number].key = $scope.serviceMetadataFields[number].name.split(' ').join('')
+ })
+ $scope.nodeTemplateFields = _.keyBy(parameters.userProvidedList, 'id');
+ };
+
+ CreationService.initializeComponent(COMPONENT.VNF);
+
+ CreationService.getParameters(handleGetParametersResponse);
+
+ $scope.back = function() {
+ $window.history.back();
+ };
+
+ $scope.searchPnf = function(pnfName) {
+ $scope.pnfInstance= false;
+ $scope.notFound=false;
+
+ AaiService.getPnfByName(pnfName)
+ .then(function (response) {
+ $scope.pnfInstance = response.data;
+ requestParams.pnf = response.data.pnfName;
+ })
+ .catch(function (error) {
+ $scope.pnfNameNotFound= pnfName;
+ $scope.notFound= true;
+ });
+
+ }
+ var modalInstance;
+
+ $scope.associate = function() {
+
+ requestParams.serviceModelInfo = vidService.getModel().service;
+ requestParams.attuuid = DataService.getLoggedInUserId();
+ requestParams.instanceId = DataService.getServiceInstanceId();
+
+ modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/mso-commit/mso-commit.html',
+ controller: "msoCommitModalController",
+ backdrop: false,
+ resolve: {
+ msoType: function () {
+ return COMPONENT.MSO_CREATE_REALATIONSHIP;
+ },
+ requestParams: function () {
+ requestParams.callbackFunction = updateViewCallbackFunction;
+ return requestParams;
+ }
+ }
+ })
+
+
+ };
+
+ var updateViewCallbackFunction = function(response) {
+ $scope.callbackResults = "";
+ var color = FIELD.ID.COLOR_NONE;
+ $scope.callbackStyle = {
+ "background-color" : color
+ };
+
+ /*
+ * This 1/2 delay was only added to visually highlight the status
+ * change. Probably not needed in the real application code.
+ */
+ $timeout(function() {
+ $scope.callbackResults = UtilityService.getCurrentTime()
+ + FIELD.STATUS.IS_SUCCESSFUL + response.isSuccessful;
+ if (response.isSuccessful) {
+ color = FIELD.ID.COLOR_8F8;
+ $scope.back();
+ } else {
+ color = FIELD.ID.COLOR_F88;
+ }
+ $scope.callbackStyle = {
+ "background-color" : color
+ };
+ }, 500);
+ };
+
+
+ $scope.cancel = function() {
+ modalInstance.dismiss('cancel');
+ };
+
+
+ }]);
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js b/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js
new file mode 100644
index 000000000..f5c3a0e0a
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/controller/testEnvironmentsController.js
@@ -0,0 +1,102 @@
+(function () {
+ 'use strict';
+
+ appDS2.controller("testEnvironmentsController", ["$uibModal", "TestEnvironmentsService", "$log", "$rootScope", "$scope", "COMPONENT", testEnvironmentsController]);
+
+ function testEnvironmentsController($uibModal, TestEnvironmentsService, $log, $rootScope, $scope, COMPONENT) {
+ var vm = this;
+
+ var toggleValue;
+
+ var init = function() {
+ vm.loadAAIestEnvironments();
+ };
+
+ vm.loadAAIestEnvironments = function() {
+ TestEnvironmentsService.loadAAIestEnvironments("VNF")
+ .then(function(response) {
+ vm.environments = response.operationalEnvironment;
+ vm.connectError = false;
+ if(!vm.environments.length) {
+ vm.emptyData = true;
+ }
+ })
+ .catch(function (error) {
+ vm.connectError = error.message || "Unknown error";
+ $log.error(error);
+ });
+ };
+
+ function handleEnvActionComplete(result) {
+ if (result.isSuccessful) {
+ vm.loadAAIestEnvironments();
+ }
+ $scope.popup.isVisible = false;
+ }
+
+ vm.onTestEnvActivateClick = function(testEnv) {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html',
+ controller: 'attachTestEnvManifestController',
+ controllerAs: 'vm',
+ resolve: {}
+ });
+
+ modalInstance.result.then(function (result) {
+ if (result) {
+
+ var relatedEcompEnv = _.find(testEnv.relationshipList.relationship, { relatedTo: "operational-environment" });
+
+ var manifest = result;
+ var envId = testEnv.operationalEnvironmentId;
+ var relatedInstanceId =
+ _.find(relatedEcompEnv.relationshipData, {"relationshipKey": "operational-environment.operational-environment-id"})
+ .relationshipValue;
+ var relatedInstanceName =
+ _.find(relatedEcompEnv.relatedToProperty, {"propertyKey": "operational-environment.operational-name"})
+ .propertyValue;
+ var workloadContext = testEnv.workloadContext;
+
+ $rootScope.$broadcast(COMPONENT.MSO_ACTIVATE_ENVIRONMENT, {
+ url: COMPONENT.MSO_ACTIVATE_ENVIRONMENT,
+ envId: envId,
+ relatedInstanceId: relatedInstanceId,
+ relatedInstanceName: relatedInstanceName,
+ workloadContext: workloadContext,
+ manifest: manifest,
+ callbackFunction: handleEnvActionComplete
+ });
+
+ }
+ });
+ };
+
+ vm.onTestEnvDeactivateClick = function(testEnv) {
+ var envId = testEnv.operationalEnvironmentId;
+ $rootScope.$broadcast(COMPONENT.MSO_DEACTIVATE_ENVIRONMENT, {
+ url : COMPONENT.MSO_DEACTIVATE_ENVIRONMENT,
+ envId : envId,
+ callbackFunction: handleEnvActionComplete
+ });
+ };
+
+ vm.isEnvActive = function(testEnv) {
+ return testEnv.operationalEnvironmentStatus==='Activate';
+ };
+
+ vm.getEnvStatus = function (testEnv) {
+ return this.isEnvActive(testEnv) ? "Active" : "Inactive";
+ };
+
+ vm.createNewTestEnvironment = function() {
+ var modalInstance = $uibModal.open({
+ templateUrl: 'app/vid/scripts/modals/new-test-environment/new-test-environment.html',
+ controller: 'newTestEnvironmentModalController',
+ controllerAs: 'vm',
+ resolve: {}
+ });
+ };
+
+ init();
+ }
+})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js
new file mode 100644
index 000000000..8ff67fac1
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/messageViewer.js
@@ -0,0 +1,17 @@
+"use strict";
+
+appDS2.directive('messageViewer', function() {
+ return {
+ restrict : "E",
+ templateUrl: 'app/vid/scripts/view-models/messageViewer.htm',
+ scope: {
+ primaryMessage:'@',
+ icon:'@',
+ secondaryMessage:'@',
+ tryAgain:'&'
+ },
+ link: function(scope, elem, attrs) {
+ scope.showTryAgain = angular.isDefined(attrs.tryAgain);
+ }
+ }
+}); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js
index e57b43ec4..d36b3823f 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js
@@ -20,7 +20,7 @@
"use strict";
-var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
+var parameterBlockDirective = function($log, PARAMETER, UtilityService, $compile) {
/*
* If "IS_SINGLE_OPTION_AUTO_SELECTED" is set to "true" ...
*
@@ -221,6 +221,9 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
+ additionalStyle + "'>" + getOptionListHtml(parameter)
+ "</select>";
break;
+ case PARAMETER.MULTI_SELECT:
+ return '<multiselect id="' + parameter.id + '"' + attributeString + ' ng-model="multiselectModel.' + parameter.id + '" options="getOptionsList(\'' + parameter.id + '\')" display-prop="name" id-prop="id"></multiselect>';
+ break;
case PARAMETER.STRING:
default:
var value = "";
@@ -255,9 +258,7 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
}
if (UtilityService.hasContents(parameter.prompt)) {
- if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1) || !(parameter.isSingleOptionAutoSelected && parameter.optionList.length === 1)) {
html += "<option value=''>" + parameter.prompt + "</option>";
- }
}
for (var i = 0; i < parameter.optionList.length; i++) {
@@ -298,7 +299,7 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
var getParameter = function(element, expectedId) {
var id = $(element).attr("parameter-id");
- if (expectedId !== undefined && expectedId !== id) {
+ if (!id || (expectedId !== undefined && expectedId !== id)) {
return undefined;
}
var parameter = {
@@ -327,14 +328,20 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
};
var getRequiredField = function(element) {
- if ($(element).prop("type") === "text") {
- $(element).val($(element).val().trim());
+ if($(element).is("multiselect")) {
+ if(!$(element).find(".active").text().trim()) {
+ return '"' + $(element).attr("parameter-name") + '"';
+ }
}
- if ($(element).val() === "" || $(element).val() === null) {
- return '"' + $(element).attr("parameter-name") + '"';
- } else {
- return "";
+ else {
+ if ($(element).prop("type") === "text") {
+ $(element).val($(element).val().trim());
+ }
+ if ($(element).val() === "" || $(element).val() === null) {
+ return '"' + $(element).attr("parameter-name") + '"';
+ }
}
+ return "";
};
var callback = function(element, scope) {
@@ -354,13 +361,20 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
link : function(scope, element, attrs) {
var control = scope.control || {};
+ scope.multiselectModel = {};
+ scope.getOptionsList = function (parameterId) {
+ return _.find(scope.parameterList, {'id': parameterId})["optionList"];
+ };
control.setList = function(parameterList) {
+ scope.parameterList = parameterList;
+ scope.multiselectModel = {};
var html = "";
for (var i = 0; i < parameterList.length; i++) {
html += getParameterHtml(parameterList[i], attrs.editable);
}
- element.html(html);
+ element.replaceWith($compile(element.html(html))(scope));
+
element.find("input, select").bind("change", function() {
callback(this, scope);
});
@@ -390,13 +404,16 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
parameterList.push(parameter);
}
});
+ angular.forEach(scope.multiselectModel, function(value, key) {
+ parameterList.push({id: key, value: value});
+ });
return parameterList;
}
control.getRequiredFields = function() {
var requiredFields = "";
var count = 0;
- element.find("input, select").each(function() {
+ element.find("input, select, multiselect").each(function() {
if ($(this).attr("is-required") === "true") {
var requiredField = getRequiredField(this);
if (requiredField !== "") {
@@ -418,7 +435,7 @@ var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
}
}
-appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService",
+appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService", "$compile",
parameterBlockDirective ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig b/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig
deleted file mode 100644
index 0e937826a..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/parameterBlockDirective.js.orig
+++ /dev/null
@@ -1,507 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-"use strict";
-
-var parameterBlockDirective = function($log, PARAMETER, UtilityService) {
- /*
- * If "IS_SINGLE_OPTION_AUTO_SELECTED" is set to "true" ...
- *
- * IF these 3 conditions all exist:
- *
- * 1) The parameter type is PARAMETER.SELECT
- *
- * 2) AND the "prompt" attribute is set to a string.
- *
- * 3) AND the optionList" only contains a single entry
- *
- * THEN the "prompt" will not be displayed as an initial select option.
- */
-
- var IS_SINGLE_OPTION_AUTO_SELECTED = true;
-
- /*
- * Optionally remove "nameStyle" and "valueStyle" "width" entries to set
- * dynamic sizing.
- */
- var tableStyle = "width: auto; margin: 0 auto; border-collapse: collapse; border: none;";
- var nameStyle = "width: 220px; text-align: left; vertical-align: middle; font-weight: bold; padding: 3px 5px; border: none;";
- var valueStyle = "width: 400px; text-align: left; vertical-align: middle; padding: 3px 5px; border: none;";
- var checkboxValueStyle = "width: 400px; text-align: center; vertical-align: middle; padding: 3px 5px; border: none;"
- var textInputStyle = "height: 25px; padding: 2px 5px;";
- var checkboxInputStyle = "height: 18px; width: 18px; padding: 2px 5px;";
- var selectStyle = "height: 25px; padding: 2px; text-align: center;";
- var requiredLabelStyle = "width: 25px; padding: 5px 10px 10px 5px;";
-
-
- var getParameterHtml = function(parameter, editable) {
- var style = valueStyle;
- var attributeString = "";
- if (parameter.type === PARAMETER.BOOLEAN) {
- style = checkboxValueStyle;
- }
- if (UtilityService.hasContents(parameter.description)) {
- attributeString += " title=' " + parameter.description + " '";
- }
- var rowstyle='';
- if(parameter.type == 'file' && !parameter.isVisiblity){
- rowstyle = ' style="display:none;"';
- }
- var html = "<tr"+rowstyle+"><td style='" + nameStyle + "'" + attributeString + ">"
- + getNameHtml(parameter) + "</td>";
- if (editable === undefined) {
- if (UtilityService.hasContents(parameter.value)) {
- html += "<td data-tests-id='" + getParameterName(parameter) + "' style='" + style + "'>" + parameter.value;
- } else {
- html += "<td data-tests-id='" + getParameterName(parameter) + "' style='" + style + "'>";
- }
- } else {
- html += "<td style='" + style + "'>" + getValueHtml(parameter);
- }
- html += "</td></tr>";
- return html;
- };
-
- var updateParameter = function(parameter, element, editable) {
- $(element).parent().parent().children("td").first().html(
- getNameHtml(parameter));
- if (editable === undefined) {
- $(element).html(parameter.value);
- } else {
- $(element).parent().html(getValueHtml(parameter));
- }
- };
-
- var getNameHtml = function(parameter) {
- if (parameter.isVisible === false) {
- return "";
- }
- var name = getParameterName(parameter);
-
- var requiredLabel = "";
- if (parameter.isRequired) {
- requiredLabel = "<img src='app/vid/images/asterisk.png' style='"
- + requiredLabelStyle + "'></img>";
- }
- return name + ":" + requiredLabel;
- };
-
- var getParameterName = function(parameter) {
- var name = "";
- if (UtilityService.hasContents(parameter.name)) {
- name = parameter.name;
- } else {
- name = parameter.id;
- }
- return name;
- }
-
- var getValueHtml = function(parameter) {
-
- var textInputPrompt = "Enter data";
- var attributeString = " data-tests-id='" + parameter.id +"' parameter-id='" + parameter.id + "'";
- var additionalStyle = "";
- if (parameter.isEnabled === false) {
- attributeString += " disabled='disabled'";
- }
- if (parameter.isRequired) {
- attributeString += " is-required='true'";
- }
- if (UtilityService.hasContents(parameter.description)) {
- attributeString += " title=' " + parameter.description + " '";
- }
- if (UtilityService.hasContents(parameter.isReadOnly) && (parameter.isReadOnly === true)) {
- attributeString += " readonly";
- }
- if ( (UtilityService.hasContents(parameter.maxLength)) && (UtilityService.hasContents(parameter.minLength)) ) {
- attributeString += " pattern='.{" + parameter.minLength + "," + parameter.maxLength + "}' required";
- }
- else if (UtilityService.hasContents(parameter.maxLength)) {
- attributeString += " maxlength='" + parameter.maxLength + "'";
- }
- else if (UtilityService.hasContents(parameter.minLength)) {
- attributeString += " pattern='.{" + parameter.minLength + ",}'"
- }
- if (parameter.isVisible === false) {
- additionalStyle = " visibility: hidden;";
- }
-
- var name = "";
- if (UtilityService.hasContents(parameter.name)) {
- name = parameter.name;
- } else {
- name = parameter.id;
- }
- attributeString += " parameter-name='" + name + "'";
-
- if ( parameter.type === PARAMETER.MAP ) {
- textInputPrompt = "{<key1>: <value1>,\.\.\.,<keyN>: <valueN>}";
- }
-
- if ( parameter.type === PARAMETER.LIST ) {
- textInputPrompt = "[<value1>,\.\.\.,<valueN>]";
- }
-
- switch (parameter.type) {
- case PARAMETER.BOOLEAN:
- if (parameter.value) {
- return "<select" + attributeString + " style='" + selectStyle
- + additionalStyle + "'>" + "<option value=true>true</option>"
- + "<option value=false>false</option>";
- + "</select>";
- }else{
- return "<select" + attributeString + " style='" + selectStyle
- + additionalStyle + "'>" + "<option value=false>false</option>"
- + "<option value=true>true</option>"
- + "</select>";
- }
- break;
- case PARAMETER.CHECKBOX:
- if (parameter.value) {
- return "<input type='checkbox' "+attributeString+ " checked='checked' style='"+checkboxInputStyle+"'"
- + " value='true'/>";
- }else{
- return "<input type='checkbox' "+attributeString+ "' style='"+checkboxInputStyle+"'"
- + " value='false'/>";
- }
- break;
- case PARAMETER.FILE:
- return "<input type='file' "+attributeString+ " id='"+parameter.id+"' value='"+parameter.value+"'/>";
- break;
- case PARAMETER.NUMBER:
- var value=parameter.value;
- var parameterSpec = "<input type='number'" + attributeString + " style='" + textInputStyle + additionalStyle + "'";
-
- if ( UtilityService.hasContents(parameter.min) ) {
- parameterSpec += " min='" + parameter.min + "'";
- }
- if ( UtilityService.hasContents(parameter.max) ) {
- parameterSpec += " max='" + parameter.max + "'";
- }
- if (UtilityService.hasContents(value)) {
- parameterSpec += " value='" + value + "'";
- }
- parameterSpec += ">";
-
- /*if(!isNaN(value) && value.toString().index('.') != -1){
- //float
- return "<input type='text'" + attributeString + " style='"
- + textInputStyle + additionalStyle + "' only-integers" + value
- + "></input>";
- } else {
- //integer
- return "<input type='text'" + attributeString + " style='"
- + textInputStyle + additionalStyle + "' only-float" + value
- + "></input>";
- }*/
- return (parameterSpec);
- break;
- case PARAMETER.SELECT:
- if (UtilityService.hasContents(parameter.prompt)) {
- attributeString += " prompt='" + parameter.prompt + "'";
- }
- return "<select" + attributeString + " style='" + selectStyle
- + additionalStyle + "'>" + getOptionListHtml(parameter)
- + "</select>";
- break;
- case PARAMETER.STRING:
- default:
- var value = "";
- if (UtilityService.hasContents(parameter.value)) {
- value = " value='" + parameter.value + "'";
- }
- if (UtilityService.hasContents(parameter.prompt)) {
- attributeString += " placeholder='" + parameter.prompt + "'";
- } else if (textInputPrompt !== "") {
- attributeString += " placeholder='" + textInputPrompt + "'";
- }
- var finalString = "<input type='text'" + attributeString + " style='"
- + textInputStyle + additionalStyle + "'" + value
- + ">";
- return finalString;
- }
- };
-
-
- var getBooleanListHtml = function(parameter){
- var html = "";
-
- };
-
- var getOptionListHtml = function(parameter) {
-
-<<<<<<< HEAD
- var html = "";
-
- if (!angular.isArray(parameter.optionList)
- || parameter.optionList.length === 0) {
- return "";
- }
-
- if (UtilityService.hasContents(parameter.prompt)) {
- if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1) || !(parameter.isSingleOptionAutoSelected && parameter.optionList.length === 1)) {
- html += "<option value=''>" + parameter.prompt + "</option>";
- }
- }
-
- for (var i = 0; i < parameter.optionList.length; i++) {
- var option = parameter.optionList[i];
- var name = option.name;
- var value = "";
- if (option.id === undefined) {
- value = option.name;
- } else {
- if (name === undefined) {
- name = option.id;
- }
- value = option.id;
- }
- if (option.isDefault === undefined || option.isDefault === false ) {
- html += "<option value='" + value + "'>" + name + "</option>";
- }
- else {
- html += "<option value='" + value + "' selected>" + name + "</option>";
- }
- }
- return html;
-=======
- var html = "";
-
- if (!angular.isArray(parameter.optionList)
- || parameter.optionList.length === 0) {
- return "";
- }
-
- if (UtilityService.hasContents(parameter.prompt)) {
- if (!(IS_SINGLE_OPTION_AUTO_SELECTED && parameter.optionList.length === 1)) {
- html += "<option value=''>" + parameter.prompt + "</option>";
- }
- }
-
- for (var i = 0; i < parameter.optionList.length; i++) {
- var option = parameter.optionList[i];
- var name = option.name;
- var value = "";
- if (option.id === undefined) {
- value = option.name;
- } else {
- if (name === undefined) {
- name = option.id;
- }
- value = option.id;
- }
- html += getOptionHtml(option.isPermitted, option.isDataLoading, value, name, parameter);
- }
- return html;
->>>>>>> 7e45cad... merge
- };
-
- function getOptionHtml(isPermitted, isDefault, value, name, parameter) {
- var html = "";
- if (isDefault === undefined || isDefault === false ) {
- if(isPermitted)
- html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + name + "</option>";
- else {
- html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + name + "</option>";
- }
- }
- else {
- if(isPermitted)
- html = "<option class='" + parameter.id + "Option' value='" + value + "'>" + "' selected>" + name + "</option>";
- else {
- html = "<option class='" + parameter.id + "Option' value='" + value + "' disabled>" + "' selected>" + name + "</option>";
- }
- }
- return html;
- }
-
- var getParameter = function(element, expectedId) {
- var id = $(element).attr("parameter-id");
- if (expectedId !== undefined && expectedId !== id) {
- return undefined;
- }
- var parameter = {
- id : id
- };
- if ($(element).prop("type") === "checkbox") {
- parameter.value = $(element).prop("checked");
- }else if ($(element).prop("type") === "file") {
- parameter.value = $('#'+id).attr("value");
-
- } else {
- if ($(element).prop("type") === "text") {
- $(element).val($(element).val().trim());
- }
- parameter.value = $(element).val();
- }
- if ($(element).prop("selectedIndex") === undefined) {
- parameter.selectedIndex = -1;
- } else {
- parameter.selectedIndex = $(element).prop("selectedIndex");
- if (UtilityService.hasContents($(element).attr("prompt"))) {
- parameter.selectedIndex--;
- }
- }
- return parameter;
- };
-
- var getRequiredField = function(element) {
- if ($(element).prop("type") === "text") {
- $(element).val($(element).val().trim());
- }
- if ($(element).val() === "" || $(element).val() === null) {
- return '"' + $(element).attr("parameter-name") + '"';
- } else {
- return "";
- }
- };
-
- var callback = function(element, scope) {
- scope.callback({
- id : $(element).attr("parameter-id")
- });
- };
-
- return {
- restrict : "EA",
- replace : true,
- template : "<div><table style='" + tableStyle + "'></table></div>",
- scope : {
- control : "=",
- callback : "&"
- },
- link : function(scope, element, attrs) {
-
- var control = scope.control || {};
-
- control.setList = function(parameterList) {
- var html = "";
- for (var i = 0; i < parameterList.length; i++) {
- html += getParameterHtml(parameterList[i], attrs.editable);
- }
- element.html(html);
- element.find("input, select").bind("change", function() {
- callback(this, scope);
- });
- }
-
- control.updateList = function(parameterList) {
- element.find("input, select").each(
- function() {
- for (var i = 0; i < parameterList.length; i++) {
- if (parameterList[i].id === $(this).attr(
- "parameter-id")) {
- updateParameter(parameterList[i], this,
- attrs.editable);
- }
- }
- });
- element.find("input, select").bind("change", function() {
- callback(this, scope);
- });
- }
-
- control.getList = function(expectedId) {
- var parameterList = new Array();
- element.find("input, select").each(function() {
- var parameter = getParameter(this, expectedId);
- if (parameter !== undefined) {
- parameterList.push(parameter);
- }
- });
- return parameterList;
- }
-
- control.getRequiredFields = function() {
- var requiredFields = "";
- var count = 0;
- element.find("input, select").each(function() {
- if ($(this).attr("is-required") === "true") {
- var requiredField = getRequiredField(this);
- if (requiredField !== "") {
- if (++count == 1) {
- requiredFields = requiredField;
- }
- }
- }
- });
- if (--count <= 0) {
- return requiredFields;
- } else if (count == 1) {
- return requiredFields + " and 1 other field";
- } else {
- return requiredFields + " and " + count + " other fields";
- }
- }
- }
- }
-}
-
-appDS2.directive('parameterBlock', [ "$log", "PARAMETER", "UtilityService",
- parameterBlockDirective ]);
-
-
-appDS2.directive('onlyIntegers', function () {
- return {
- restrict: 'A',
- link: function (scope, elm, attrs, ctrl) {
- elm.on('keydown', function (event) {
- if(event.shiftKey){event.preventDefault(); return false;}
- //console.log(event.which);
- if ([8, 13, 27, 37, 38, 39, 40].indexOf(event.which) > -1) {
- // backspace, enter, escape, arrows
- return true;
- } else if (event.which >= 49 && event.which <= 57) {
- // numbers
- return true;
- } else if (event.which >= 96 && event.which <= 105) {
- // numpad number
- return true;
- }
- // else if ([110, 190].indexOf(event.which) > -1) {
- // // dot and numpad dot
- // return true;
- // }
- else {
- event.preventDefault();
- return false;
- }
- });
- }
- }
-});
-
-appDS2.directive('onlyFloat', function () {
- return {
- restrict: 'A',
- link: function (scope, elm, attrs, ctrl) {
- elm.on('keydown', function (event) {
- if ([110, 190].indexOf(event.which) > -1) {
- // dot and numpad dot
- event.preventDefault();
- return true;
- }
- else{
- return false;
- }
- });
- }
- }
-});
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js
index ed71436bb..76585f4bc 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/progressBarDirective.js
@@ -58,7 +58,7 @@
* called immediately after HTML is rendered. This is due to a timing-related
* behavior.
*
- * 3) The progress bar displays values of "0" and "100" if precentProgress is,
+ * 3) The progress bar displays values of "0" and "100" if percentProgress is,
* respectively, less than 0 or greater than 100.
*
* CUSTOM STYLING:
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js b/vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js
new file mode 100644
index 000000000..05ae1211c
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/search.js
@@ -0,0 +1,11 @@
+"use strict";
+
+appDS2.directive('searchText', function() {
+ return {
+ restrict : "E",
+ templateUrl: 'app/vid/scripts/view-models/search.htm',
+ scope: {
+ searchString : '='
+ }
+ }
+}); \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoClientFactory.java b/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
index fb0ead440..1c15f7034 100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoClientFactory.java
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/directives/serviceMetadata.js
@@ -18,20 +18,17 @@
* ============LICENSE_END=========================================================
*/
-package org.openecomp.vid.mso;
+"use strict";
-import org.openecomp.vid.mso.rest.MsoRestClientNew;
-
-/**
- * A factory for creating MsoRestInterface objects.
- */
-public class MsoClientFactory {
-
- /**
- * MSO client factory that creates the right client according to env.
- * @return
- */
- public static MsoInterface getInstance() {
- return new MsoRestClientNew();
+appDS2.directive('serviceMetadata', function() {
+ return {
+ restrict : "E",
+ templateUrl: 'app/vid/scripts/view-models/serviceMetadata.htm',
+ scope: {
+ serviceMetadataFields : '=',
+ titleTxt: '@'
+ },
+ link : function(scope, element, attrs) {
+ }
}
-}
+}); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html
index bdc95c98e..60596f499 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-change-management/alert-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/alert-change-management/alert-change-management.css" />
<div class="modal-header">
<h3 class="modal-title" id="alert-modal-header">On Hold</h3>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js
new file mode 100644
index 000000000..6cb3f9c89
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.controller.js
@@ -0,0 +1,33 @@
+(function () {
+ 'use strict';
+
+ appDS2.controller("alertModalController", ["$uibModalInstance", "jobInfo",
+ "$log", alertModalController]);
+
+ function alertModalController($uibModalInstance, jobInfo, $log) {
+ var vm = this;
+ var init = function() {
+ if (jobInfo) {
+ vm.content = jobInfo.message;
+ vm.mode = jobInfo.status;
+ if (vm.mode == "failed") {
+ vm.Header = "Failed"
+ } else if (vm.mode == "confirm") {
+ vm.Header = "Confirm"
+ } else {
+ vm.Header = "Success"
+ }
+ }
+ };
+
+ vm.close = function () {
+ $uibModalInstance.close();
+ };
+
+ vm.ok = function () {
+ $uibModalInstance.close(true);
+ };
+
+ init();
+ }
+})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css
new file mode 100644
index 000000000..85382b0ee
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.css
@@ -0,0 +1,15 @@
+.modal-header {
+ border-bottom-color: #ffb81c;
+}
+.modal-header.success {
+ border-bottom: 3px solid #4ca90c;
+}
+.modal-header.failed {
+ border-bottom: 3px solid #cf2a2a;
+}
+.modal-header.confirm {
+ border-bottom: 3px solid #009FDB;
+}
+.modal-footer {
+ border-radius: 0 0 6px 6px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html
new file mode 100644
index 000000000..4fa9d4587
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-modal/alert-modal.html
@@ -0,0 +1,15 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modals.css">
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/alert-modal/alert-modal.css" />
+<div class="modal-header" ng-class="vm.mode">
+ <span class="modal-title" id="alert-modal-header">{{vm.Header}}</span>
+ <span id="cancel" ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<div class="modal-body">
+ <span id="failed-modal-content">{{vm.content}}</span>
+</div>
+<div class="modal-footer">
+ <div class="pull-right">
+ <button data-tests-id="ok" id="ok-button" name="ok" class="btn"
+ ng-click="vm.ok()">OK</button>
+ </div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js
deleted file mode 100644
index 2c5eabed9..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.controller.js
+++ /dev/null
@@ -1,33 +0,0 @@
-(function () {
- 'use strict';
-
- appDS2.controller("alertNewSchedulerController", ["$uibModalInstance", "jobInfo", "MsoService", "COMPONENT",
- "$log", alertNewSchedulerController]);
-
- function alertNewSchedulerController($uibModalInstance, jobInfo, MsoService, COMPONENT, $log) {
- var vm = this;
-
- vm.manualTasks = [];
- vm.MANUAL_TASKS = COMPONENT.MANUAL_TASKS;
- var init = function() {
- if (jobInfo) {
- vm.content = jobInfo;
- } else {
- vm.content = "Successfully";
- }
-
-
-
- };
-
-
-
-
-
- vm.close = function () {
- $uibModalInstance.close();
- };
-
- init();
- }
-})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css
deleted file mode 100644
index 316c2e46e..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.css
+++ /dev/null
@@ -1,3 +0,0 @@
-.modal-header h3 {
- border-bottom: 3px solid #ffb81c;
-} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html
deleted file mode 100644
index e6255cf36..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/alert-change-management/alert-change-management.css" />
-<div class="modal-header">
- <h3 class="modal-title" id="alert-modal-header">Response From Server</h3>
- <span id="cancel" ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
-</div>
-<div class="modal-body">
- <span id="alert-modal-content">{{vm.content}}</span>
-</div>
-<div class="modal-footer">
-<!-- <div ng-include="'app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html'"></div> -->
-</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js
new file mode 100644
index 000000000..930240437
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.controller.js
@@ -0,0 +1,58 @@
+(function () {
+ 'use strict';
+
+ appDS2.controller("attachTestEnvManifestController", ["$uibModalInstance", "$uibModal", "$log", "$scope",
+ attachTestEnvManifestController]);
+
+ function attachTestEnvManifestController($uibModalInstance, $uibModal, $log, $scope) {
+ var vm = this;
+
+ var init = function () {
+ vm.manifest = "";
+ vm.error="";
+ };
+
+ vm.close = function () {
+ $uibModalInstance.close();
+ };
+
+ vm.submit = function () {
+ $uibModalInstance.close(vm.manifest);
+ };
+
+ vm.isSubmitDisabled = function () {
+ return !(vm.manifest);
+ };
+
+
+
+ /*
+ Must be $scope because we bind to the onchange of the html (cannot attached to vm variable).
+ We use scope because angular doesn't support ng-change on input file
+ https://github.com/angular/angular.js/issues/1375
+ https://stackoverflow.com/questions/17922557/angularjs-how-to-check-for-changes-in-file-input-fields
+ */
+ $scope.selectAttachmentManifest = function (fileInput) {
+ if (fileInput && fileInput.id) {
+ vm.manifest = "";
+ vm.error="";
+ var file = fileInput.files[0];
+ vm.filename=file.name;
+ var fileReader = new FileReader();
+ fileReader.onload = function (load) {
+ try {
+ var lines = load.target.result;
+ vm.manifest = JSON.parse(lines);
+ } catch (error) {
+ $log.error(error);
+ vm.error = "file: " + vm.filename + " is not a valid JSON"
+ }
+ $scope.$apply();
+ };
+ fileReader.readAsText(file);
+ }
+ };
+
+ init();
+ }
+})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css
new file mode 100644
index 000000000..ff06addbb
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css
@@ -0,0 +1,109 @@
+.modal-header {
+ border: none!important;
+ padding: 10px 20px 0px 20px!important;
+ font-family: "OpenSans-Light";
+ font-size: 22px;
+ color: #000000;
+}
+
+.modal-header h3 {
+ font-family: "OpenSans-Light";
+ color: #000000;
+ color: #000000;
+ font-size: 22px;
+ font-weight: 300;
+ line-height: 16px;
+ padding-bottom: 20px;
+ border-bottom: 3px solid #009fdb;
+
+}
+
+.control-label {
+ font-family: "OpenSans-Light";
+ color: #5a5a5a;
+ font-size: 13px;
+ font-weight: 400;
+}
+
+.modal-content {
+ width: 468px;
+ height: 242px;
+ border-radius: 8px;
+ background-color: #ffffff;
+}
+
+body .modal-body {
+ padding-bottom: 0;
+ padding-top: 0;
+ padding-left: 20px;
+ padding-right: 20px;
+ width: 468px;
+ height: 91px;
+}
+
+.modal-footer {
+ margin-top: 0;
+ background-color: #fff;
+}
+
+
+.modal-close {
+ margin: -60px 5px 0 0;
+ color: #5a5a5a;
+ font-size: 20px;
+ cursor: pointer;
+}
+
+.inputfile {
+ width: 0.1px;
+ height: 0.1px;
+ opacity: 0;
+ overflow: hidden;
+ position: absolute;
+ z-index: -1;
+}
+
+.manifestName{
+ font-family: OpenSans-Semibold;
+ font-size: 12px;
+ color: #191919;
+}
+
+.manifestFileName {
+ width: 389px;
+ height: 37px;
+ background: #FFFFFF;
+ border: 1px solid #D2D2D2;
+ border-radius: 2px;
+ display: inline-block;
+ line-height: 37px;
+ font-weight: normal !important;
+ padding-left: 3px;
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+}
+
+.elipsisImg {
+ width: 37px;
+ padding: 10px;
+ background: #FFFFFF;
+ border: 1px solid #D2D2D2;
+ display: inline-block;
+ cursor: pointer;
+ vertical-align: top;
+ border-radius: 2px;
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+}
+
+.labelForImage {
+ vertical-align: top;
+}
+
+.errorLabel {
+ color: red;
+}
+
+
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html
new file mode 100644
index 000000000..12e0ab33f
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.html
@@ -0,0 +1,26 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-buttons.css">
+<link rel="stylesheet" type="text/css"
+ href="app/vid/scripts/modals/attach-test-env-manifest/attach-test-env-manifest.css"/>
+<div class="modal-header">
+ <h3 id="modal-title">Attach Manifest</h3>
+ <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<form name="Attach Manifest" ng-submit="vm.submit()">
+ <div class="modal-body">
+ <label id="manifestName" class="manifestName">Manifest Name</label>
+ <input onchange="angular.element(this).scope().selectAttachmentManifest(this)" type="file"
+ id="testEnvManifestFileInput" class="inputfile" accept=".json"/>
+ <label id="manifestFileName" class="manifestFileName">{{vm.filename}}</label><label for="testEnvManifestFileInput" class="labelForImage" >
+ <span class="icon-browse"></span>
+ </label><label id="errorLabel" class="errorLabel">{{vm.error}}</label>
+
+ </div>
+ <div class="modal-footer">
+ <div class="pull-right">
+ <button type="submit" id="submit" name="submit" class="btn btn-primary"
+ ng-disabled="vm.isSubmitDisabled()">Attach
+ </button>
+ <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
+ </div>
+ </div>
+</form>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js
new file mode 100644
index 000000000..a04e127db
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.controller.js
@@ -0,0 +1,29 @@
+(function () {
+ 'use strict';
+
+ appDS2.controller("cancelPendingWorkflowController", ["$scope", "$uibModalInstance", "changeManagement",
+ "$log", cancelPendingWorkflowController]);
+
+ function cancelPendingWorkflowController($scope, $uibModalInstance, changeManagement, $log) {
+ var vm = this;
+
+ function init() {
+ if (changeManagement) {
+ vm.workflow = changeManagement;
+ } else {
+ console.log("Pending Workflow is undefined: ", changeManagement);
+ vm.workflow = null;
+ }
+ }
+
+ vm.close = function () {
+ $uibModalInstance.close();
+ };
+
+ vm.ok = function () {
+ $uibModalInstance.close(true);
+ };
+
+ init();
+ }
+})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css
new file mode 100644
index 000000000..daf86538a
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css
@@ -0,0 +1,16 @@
+.modal {
+ position: inherit;
+ text-align: left;
+}
+.modal-dialog {
+ position: absolute;
+ right: 0;
+ display: inline;
+ margin-top: -243px;
+}
+.modal-header {
+ border-bottom-color: #009FDB;
+}
+.modal-content {
+ width: 540px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html
new file mode 100644
index 000000000..6dca76d25
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.html
@@ -0,0 +1,14 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modals.css">
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/cancel-pending-workflow/cancel-pending-workflow.css"/>
+<div class="modal-header">
+ <span class="modal-title" id="pending-modal-header">Pending</span>
+ <span id="cancel" ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<div class="modal-body" id="modal-body">
+ Are you sure you want to delete workflow
+ <br/>
+ {{vm.workflow.scheduleRequest.scheduleName}}?
+</div>
+<div class="modal-footer">
+ <button class="btn btn-cancel-workflow" data-tests-id="cancel" ng-click="vm.ok()">Cancel Workflow</button>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html
index 0deaf93d2..d51620d0c 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/failed-change-management/failed-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/failed-change-management/failed-change-management.css" />
<div class="modal-header">
<h3 class="modal-title" id="failed-modal-header">Failed</h3>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html
index 9b40db2a5..615c95ceb 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/in-progress-modal-management/in-progress-change-management.css" />
<div class="modal-header">
<h3 class="modal-title" id="in-progress-modal-header">In Progress</h3>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css
new file mode 100644
index 000000000..6af5a66ec
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.css
@@ -0,0 +1,6 @@
+.modal-dialog .popupContents .log {
+ width: 560px;
+}
+.modal-dialog .cancel-btn {
+ width: 120px;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html
new file mode 100644
index 000000000..7698981c3
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/mso-commit/mso-commit.html
@@ -0,0 +1,48 @@
+<!--
+ ============LICENSE_START=======================================================
+ VID
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/mso-commit/mso-commit.css"/>
+
+<div class="modal-wrapper popupContents" data-tests-id="msoPopup">
+
+ <div class="statusLine">
+ <img src="app/vid/images/spinner.gif"
+ ngx-visible="{{isSpinnerVisible}}"> </img> <label>Status:</label><span
+ class="status" data-tests-id="msoRequestStatus">{{status}}</span>
+ </div>
+
+ <div class="feedback">
+
+ <div progress-bar control="progressBarControl"
+ value="{{percentProgress}}" increases-only="true"
+ ngx-show="{{isProgressVisible}}"></div>
+
+ <div class="error" ng-hide="isProgressVisible">
+ <img src="app/vid/images/error.png"></img>{{error}}
+ </div>
+
+ </div>
+
+ <pre class="log">{{log}}</pre>
+
+ <div class="buttonRow">
+ <button data-tests-id="msoCommitDialogCloseButton" ngx-enabled="{{isCloseEnabled}}" att-button size="small"
+ ng-click="close();">Close</button>
+ </div>
+</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
index 14ca43b56..f0b85a6e3 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.controller.js
@@ -1,11 +1,16 @@
(function () {
'use strict';
- appDS2.controller("newChangeManagementModalController", ["$uibModalInstance", "$uibModal", "AaiService", "changeManagementService",
- "$log", "$scope", "_", newChangeManagementModalController]);
+ appDS2.controller("newChangeManagementModalController", ["$uibModalInstance", "$uibModal",'$q', "AaiService", "changeManagementService", "Upload",
+ "$log", "$scope", "_", "COMPONENT", "VIDCONFIGURATION", newChangeManagementModalController]);
+
+ function newChangeManagementModalController($uibModalInstance, $uibModal,$q, AaiService, changeManagementService, Upload, $log, $scope, _, COMPONENT, VIDCONFIGURATION) {
- function newChangeManagementModalController($uibModalInstance, $uibModal, AaiService, changeManagementService, $log, $scope, _) {
var vm = this;
+ vm.configUpdatePatternError = "Invalid file type. Please select a file with a CSV extension.";
+ vm.configUpdateContentError = "Invalid file structure.";
+
+ vm.softwareVersionRegex = "[-a-zA-Z0-9\.]+";
var init = function () {
vm.changeManagement = {};
@@ -46,8 +51,8 @@
availableVersions.push(extractVNFModel(vnf, response.data.service, newVNFName));
}
});
- var versions = _.uniqBy(availableVersions, ['modelInfo.modelVersion']);
- newVNFName.availableVersions = _.uniq(versions, response.data.service, true);
+ var versions = _.uniqBy(availableVersions, 'modelInfo.modelVersion');
+ newVNFName.availableVersions = _.sortBy(_.uniq(versions, response.data.service, true),"modelInfo.modelVersion");
}).catch(function (error) {
$log.error(error);
});
@@ -107,23 +112,41 @@
$uibModalInstance.close();
};
- vm.schedule = function () {
- $uibModalInstance.close(vm.changeManagement);
-
- var modalInstance = $uibModal.open({
- templateUrl: 'app/vid/scripts/modals/new-scheduler/new-scheduler.html',
- controller: 'newSchedulerController',
- controllerAs: 'vm',
- resolve: {
- changeManagement: function () {
- return vm.changeManagement;
- }
- }
+ vm.uploadConfigFile = function (file) {
+ var defer = $q.defer();
+ Upload.upload({
+ url: "change-management/uploadConfigUpdateFile",
+ file: file,
+ transformResponse: [function (data) {
+ return data;
+ }]
+ })
+ .then(function (configUpdateResponse) {
+ vm.changeManagement.configUpdateFile = configUpdateResponse && JSON.parse(configUpdateResponse.data).payload;
+ defer.resolve(true);
+ })
+ .catch(function (error) {
+ defer.resolve(false);
});
+ return defer.promise;
+ };
- modalInstance.result.then(function (result) {
- console.log("This is the result of the new change management modal.", result);
- })
+
+ vm.openModal = function () {
+ $scope.widgetParameter = ""; // needed by the scheduler?
+
+ // properties needed by the scheduler so it knows whether to show
+ // policy or sniro related features on the scheduler UI or not.
+ vm.changeManagement.policyYN = "Y";
+ vm.changeManagement.sniroYN = "Y";
+
+ var data = {
+ widgetName: 'Portal-Common-Scheduler',
+ widgetData: vm.changeManagement,
+ widgetParameter: $scope.widgetParameter
+ };
+
+ window.parent.postMessage(data, VIDCONFIGURATION.SCHEDULER_PORTAL_URL);
};
vm.loadSubscribers = function () {
@@ -165,11 +188,11 @@
if (vnfsData[i]) {
const nodeType = vnfsData[i]['node-type'];
if (nodeType === "generic-vnf") {
- _.forEach(vnfsData[i]['related-to'], function (node) {
- if (node['node-type'] === 'vserver') {
- vm.vnfs.push(vnfsData[i]);
- }
- })
+ if (_.find(vnfsData[i]['related-to'], function (node) {
+ return node['node-type'] === 'vserver'
+ }) !== undefined) {
+ vm.vnfs.push(vnfsData[i]);
+ }
} else if (nodeType === "service-instance") {
vm.serviceInstances.push(vnfsData[i]);
}
@@ -197,63 +220,50 @@
);
};
+ var fromVNFVersions = [];
+
vm.loadVNFVersions = function () {
- vm.fromVNFVersions = [];
+ fromVNFVersions = [];
vm.serviceInstancesToGetVersions = [];
var versions = [];
_.forEach(vm.vnfs, function (vnf) {
if (vnf.properties['nf-role'] === vm.changeManagement['vnfType']) {
- vm.serviceInstancesToGetVersions.push(vnf);
-
- versions.push(vnf.properties["model-invariant-id"]);
-
+ vm.serviceInstancesToGetVersions.push({
+ "model-invariant-id": vnf.properties["model-invariant-id"],
+ "model-version-id": vnf.properties["model-version-id"] }
+ );
+ versions.push(vnf.properties["model-invariant-id"]);
}
});
- AaiService.getVnfVersionsByInvariantId(versions).then(function (response) {
- if (response.data) {
- var key = response.data.model["0"]["model-invariant-id"];
- var value = response.data.model["0"]["model-vers"]["model-ver"]["0"]["model-version"];
- var element = {"key": key, "value": value};
- vm.fromVNFVersions.push(element);
- }
- //TODO promise all and call the new api to get the versions.
- // vm.fromVNFVersions.push(response.data.model["0"]["model-vers"]["model-ver"]["0"]["model-version"]);
- // if(vm.serviceInstancesToGetVersions.length > 0){
- //
- // var promiseArrOfGetVnfs = preparePromiseArrOfGetVersions('a9a77d5a-123e-4ca2-9eb9-0b015d2ee0fb');
- //
- // Promise.all(promiseArrOfGetVnfs).then(function (allData) {
- // vm.vnfs = _.flattenDeep(_.without(allData, null));
- // var filteredVnfs = _.sortedUniqBy(vm.vnfs, function (vnf) {
- // return vnf.properties.vnfType;
- // });
- //
- // _.forEach(filteredVnfs, function (vnf) {
- // vm.vnfTypes.push(vnf.properties.vnfType)
- // });
- //
- // }).catch(function (error) {
- // $log(error);
- // });
- // }
- })
- // debugger;
+ if (versions.length > 0) {
+ AaiService.getVnfVersionsByInvariantId(versions).then(function (response) {
+ if (response.data) {
+
+ $log.debug("getVnfVersionsByInvariantId: response", response);
+
+ fromVNFVersions = vm.serviceInstancesToGetVersions
+ .map(function (serviceInstanceToGetVersion) {
+ const model = _.find(response.data.model, {'model-invariant-id': serviceInstanceToGetVersion['model-invariant-id']});
+ $log.debug("getVnfVersionsByInvariantId: model for " + serviceInstanceToGetVersion['model-invariant-id'], model);
+
+ const modelVer = _.find(model["model-vers"]["model-ver"], {'model-version-id': serviceInstanceToGetVersion['model-version-id']});
+ $log.debug("getVnfVersionsByInvariantId: modelVer for " + serviceInstanceToGetVersion['model-version-id'], modelVer);
+
+ var modelVersionId = serviceInstanceToGetVersion["model-version-id"];
+ var modelVersion = modelVer["model-version"];
+ return {"key": modelVersionId, "value": modelVersion};
+ });
+
+ vm.fromVNFVersions = _.uniqBy(fromVNFVersions, 'value');
+ }
+ })
+ }
};
- // function preparePromiseArrOfGetVersions(serviceInstances) {
- // var promiseArr = [];
- // for (var i = 0; i < serviceInstances.length; i++) {
- // var modelInvariantId = serviceInstances[i].properties["model-invariant-id"];
- // promiseArr.push(
- // getVnfs(modelInvariantId)
- // );
- // }
- // return promiseArr;
- // }
function getVnfs(modelInvariantId) {
return new Promise(function (resolve, reject) {
@@ -281,12 +291,20 @@
});
}
+ var getVersionNameForId = function(versionId) {
+ var version = _.find(fromVNFVersions, {"key": versionId});
+ return version.value;
+ };
+
vm.loadVNFNames = function () {
vm.vnfNames = [];
+ const vnfs = vm.changeManagement.fromVNFVersion ? vm.vnfs : [];
+ _.forEach(vnfs, function (vnf) {
- _.forEach(vm.vnfs, function (vnf) {
+ var selectedVersionNumber = getVersionNameForId(vm.changeManagement.fromVNFVersion);
- if (vnf.properties['nf-role'] === vm.changeManagement.vnfType) {
+ if (vnf.properties['nf-role'] === vm.changeManagement.vnfType &&
+ selectedVersionNumber === getVersionNameForId(vnf.properties["model-version-id"])) {
var vServer = {};
_.forEach(vnf['related-to'], function (node) {
@@ -295,11 +313,27 @@
}
});
+ var serviceInstancesIds =
+ _.filter(vnf['related-to'], {'node-type': 'service-instance'})
+ .map(function (serviceInstance) { return serviceInstance.id });
+
+ var serviceInstances = _.filter(vm.serviceInstances, function(serviceInstance) {
+ return _.includes(serviceInstancesIds, serviceInstance.id);
+ });
+
+ // logging only
+ if (serviceInstancesIds.length === 0) {
+ $log.error("loadVNFNames: no serviceInstancesIds for vnf", vnf);
+ } else {
+ $log.debug("loadVNFNames: serviceInstancesIds", serviceInstancesIds);
+ $log.debug("loadVNFNames: serviceInstances", serviceInstances);
+ }
+
vm.vnfNames.push({
"id": vnf.properties["vnf-id"],
"name": vnf.properties["vnf-name"],
"invariant-id": vnf.properties["model-invariant-id"],
- "service-instance-node": _.filter(vm.serviceInstances, {id: vnf["related-to"][0].id}),
+ "service-instance-node": serviceInstances,
"modelVersionId": vnf.properties["model-version-id"],
"properties": vnf.properties,
'cloudConfiguration': vServer,
@@ -316,30 +350,32 @@
tenantId: ''
};
- var splitedUrlByDash = _.split(url, '/', 100);
+ /*
+ e.g., in both URLs below -
+   - lcpCloudRegionId == 'rdm5b'
+   - tenantId == '0675e0709bd7444a9e13eba8b40edb3c'
- cloudConfiguration.lcpCloudRegionId = splitedUrlByDash[7];
- cloudConfiguration.tenantId = splitedUrlByDash[10];
+ "url": "https://aai-conexus-e2e.ecomp.cci.att.com:8443/aai/v10/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/0675e0709bd7444a9e13eba8b40edb3c/vservers/vserver/932b330d-733e-427d-a519-14eebd261f70"
+ "url": "/aai/v11/cloud-infrastructure/cloud-regions/cloud-region/att-aic/rdm5b/tenants/tenant/0675e0709bd7444a9e13eba8b40edb3c/vservers/vserver/932b330d-733e-427d-a519-14eebd261f70"
+ */
+
+ var cloudRegionMatch = url.match(/\/cloud-regions\/cloud-region\/[^\/]+\/([^\/]+)/);
+ var tenantMatch = url.match(/\/tenants\/tenant\/([^\/]+)/);
+
+ cloudConfiguration.lcpCloudRegionId = cloudRegionMatch[1];
+ cloudConfiguration.tenantId = tenantMatch[1];
return cloudConfiguration;
};
vm.loadWorkFlows = function () {
- var vnfs = [];
- angular.forEach(vm.changeManagement.vnfNames, function (vnfName) {
- vnfs.push(vnfName.name)
- });
-
- //TODO: When we'll have the mappings, use the backend call to get the workflows
- // changeManagementService.getWorkflows(vnfs)
- // .then(function(response) {
- // vm.workflows = response.data;
- // })
- // .catch(function(error) {
- // $log.error(error);
- // });
-
- vm.workflows = ["Update", "Replace"];
+ changeManagementService.getWorkflows(vm.changeManagement.vnfNames)
+ .then(function(response) {
+ vm.workflows = response.data.workflows;
+ })
+ .catch(function(error) {
+ $log.error(error);
+ });
};
//Must be $scope because we bind to the onchange of the html (cannot attached to vm variable).
@@ -364,6 +400,14 @@
console.log("Will add version for selected vnf name: " + vnfName.name);
};
+ vm.isConfigUpdate = function () {
+ return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfConfigUpdate;
+ }
+
+ vm.shouldShowVnfInPlaceFields = function () {
+ return vm.changeManagement.workflow === COMPONENT.WORKFLOWS.vnfInPlace;
+ };
+
init();
}
})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css
deleted file mode 100644
index 9d270987a..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.css
+++ /dev/null
@@ -1,130 +0,0 @@
-.btn-white {
- font-family: "Open Sans";
- border-radius: 2px;
- border: 1px solid #d8d8d8;
- background-color: #ffffff;
- width: 94px;
- height: 30px;
- color: #5a5a5a;
- font-size: 13px;
- font-weight: 400;
- line-height: 36px;
- text-align: center;
- padding: 4px 12px !important;
-}
-
-.btn-primary {
- font-family: "Open Sans";
- border-radius: 2px;
- border: 1px solid #0091c8;
- background-color: #009fdb;
- width: 94px;
- height: 30px;
- color: #ffffff;
- font-size: 13px;
- font-weight: 400;
- line-height: 36px;
- text-align: center;
- padding: 4px 12px !important;
-}
-
-.modal-header {
- border: none!important;
- padding: 15px 15px 0px 15px!important;
-}
-
-.modal-header h3 {
- font-family: "Open Sans";
- color: #191919;
- font-size: 22px;
- font-weight: 300;
- line-height: 16px;
- padding-bottom: 20px;
- border-bottom: 3px solid #009fdb;
-
-}
-
-.control-label {
- font-family: "Open Sans";
- color: #5a5a5a;
- font-size: 13px;
- font-weight: 400;
-}
-
-.modal-footer {
- background-color: #eaeaea;
-}
-
-.modal-dialog {
- width: 587px;
- border-radius: 8px;
-}
-
-.modal-content {
- width: 587px;
- border-radius: 8px;
- background-color: #ffffff;
-}
-
-button.dropdown-toggle {
- text-align: left;
-}
-
-button[disabled].dropdown-toggle {
- opacity: 1;
- cursor: not-allowed;
- background-color: #eee;
- border: 1px solid #aaa;
- color: #a0a0a0;
-}
-
-multiselect[disabled] {
- cursor: not-allowed;
-}
-
-a.item-unselected:before {
- font-family: "icomoon"!important;
- content: "\e90c";
- color: #4ca90c;
-}
-
-.modal-close {
- margin: -40px 5px 0 0;
- color: #5a5a5a;
- font-size: 20px;
- cursor: pointer;
-}
-
-.vnf-versions-container .table {
- position: relative;
- background-color: #f8f8f8;
- background-clip: padding-box;
- border-radius: 6px;
- outline: 0;
-}
-
-.vnf-versions-name {
- padding-top: 6px;
- font-family: "Open Sans";
- position: absolute;
-}
-
-.vnf-versions-select-as-text {
- font-family: "Open Sans";
- appearance: none;
- -webkit-appearance: none;
- -moz-appearance: none;
- border: none;
- overflow:hidden;
- background-color: #f8f8f8;
- height: 31px;
-}
-
-.vnf-files-select {
- z-index: 999;
- opacity: 0.0;
- position: absolute;
- width: 23%;
- cursor: pointer;
- height:100%;
-}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
index 71c7eb331..4473ee3b8 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-change-management/new-change-management.html
@@ -1,51 +1,51 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
<div class="modal-header">
<h3 class="modal-title" id="modal-title">New VNF Change</h3>
<span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
</div>
-<form name="newChangeManagement" ng-submit="vm.schedule()">
+<form class="form-create" name="newChangeManagement" ng-submit="vm.openModal();vm.close();" novalidate>
<div class="modal-body">
<div class="form-group">
<label class="control-label">Subscriber</label>
<select class="form-control" ng-model="vm.changeManagement.subscriberId" ng-change="vm.loadServiceTypes()" name="subscriber" id="subscriber" data-tests-id="subscriberName" required>
<option value="" disabled>Select subscriber</option>
- <option data-tests-id="subscriberNameOption" ng-repeat="item in vm.subscribers" ng-value="item['global-customer-id']">{{item['subscriber-name']}}</option>
+ <option data-tests-id="subscriberNameOption" class="subscriberNameOption" ng-repeat="item in vm.subscribers" ng-value="item['global-customer-id']" ng-disabled="!(item['is-permitted'])">{{item['subscriber-name']}}</option>
</select>
</div>
<div class="form-group">
<label class="control-label">Service type</label>
- <select class="form-control" ng-model="vm.changeManagement.serviceType" ng-change="vm.loadVNFTypes()" name="serviceType" id="serviceType" ng-options="item['service-type'] for item in vm.serviceTypes" required data-ng-disabled="newChangeManagement.subscriber.$pristine">
+ <select class="form-control" ng-model="vm.changeManagement.serviceType" ng-change="vm.loadVNFTypes()" name="serviceType" id="serviceType" ng-options="item['service-type'] disable when !(item['is-permitted']) for item in vm.serviceTypes" required data-ng-disabled="newChangeManagement.subscriber.$pristine" data-tests-id="serviceType">
<option value="" disabled>Select service type</option>
</select>
</div>
<div class="form-group">
- <label class="control-label">VNF type</label>
+ <label class="control-label">NF Role</label>
<select class="form-control" ng-model="vm.changeManagement.vnfType" ng-change="vm.loadVNFVersions()" name="vnfType" id="vnfType" ng-options="item for item in vm.vnfTypes" required data-ng-disabled="newChangeManagement.serviceType.$pristine">
- <option value="" disabled>Select VNF type</option>
+ <option value="" disabled>NF Role</option>
</select>
</div>
<div class="form-group">
- <label class="control-label">Source Version</label>
+ <label class="control-label">Source VNF Model Version</label>
<select class="form-control" ng-model="vm.changeManagement.fromVNFVersion" ng-change="vm.loadVNFNames()" name="fromVNFVersion" id="fromVNFVersion" ng-options="item.key as item.value for item in vm.fromVNFVersions" required data-ng-disabled="newChangeManagement.vnfType.$pristine">
- <option value="" disabled>Select from VNF version</option>
+ <option value="" disabled>Select VNF Model Version</option>
</select>
</div>
<div class="form-group">
- <label class="control-label">VNF name</label>
+ <label class="control-label">Available VNF</label>
<multiselect ng-model="vm.changeManagement.vnfNames" ng-change="vm.loadWorkFlows()" name="vnfName" id="vnfName" options="vm.vnfNames" display-prop="name" id-prop="id" required data-ng-disabled="newChangeManagement.fromVNFVersion.$pristine"></multiselect>
</div>
<div ng-show="vm.changeManagement.vnfNames && vm.changeManagement.vnfNames.length > 0" class="form-group vnf-versions-container">
<table class="table table-bordered">
<tbody>
<tr ng-repeat="vnfName in vm.changeManagement.vnfNames">
- <td class="col-md-6"><span class="vnf-versions-name">{{vnfName.name}}</span></td>
- <td class="col-md-3">
- <select ng-model="vnfName.version" ng-change="vm.selectVersionForVNFName(vnfName)" class="vnf-versions-select-as-text">
- <option value="" disabled="" selected="selected">Select Target Version</option>
+ <td class="col-md-2"><span class="vnf-versions-name">{{vnfName.name}}</span></td>
+ <td class="col-md-2">
+ <select ng-model="vnfName.version" ng-change="vm.selectVersionForVNFName(vnfName)" class="vnf-versions-select-as-text" id="{{vnfName['invariant-id']}}-target-version-select">
+ <option value="" disabled="" selected="selected">Select Target VNF Model Version</option>
<option ng-repeat="version in vnfName.availableVersions">{{version.modelInfo.modelVersion}}</option>
</select>
</td>
- <td class="col-md-3 vnf-versions-name">
+ <td class="col-md-1 vnf-versions-name">
<input ng-model="vnfName.filePath" onchange="angular.element(this).scope().selectFileForVNFName(this)" type="file" id="{{vnfName['invariant-id']}}" class="vnf-files-select" />
<span class="vnf-versions-name">Select File<span class="caret"></span></span></td>
</tr>
@@ -58,6 +58,32 @@
<option value="" disabled>Select workflow</option>
</select>
</div>
+ <div class="form-group" ng-if="vm.isConfigUpdate()">
+ <label class="control-label">Attach configuration file</label>
+ <div class="file-wrapper">
+ <input id="config-update-input" class="file-input" type="file" ngf-select ng-model="vm.configUpdateFile" ngf-validate-async-fn="vm.uploadConfigFile($file)" name="configUpdateFile"
+ accept=".csv" ngf-pattern=".csv" required> </input>
+ <label id="config-update-label" class="file-input-label">{{vm.configUpdateFile&&vm.configUpdateFile.name||"Select File"}} </label>
+ <label for="config-update-input"><span class="icon-browse"></span></label>
+ </div>
+ <label id="errorLabel" class="icon-alert error" ng-if="newChangeManagement.configUpdateFile.$error.pattern">{{vm.configUpdatePatternError}}</label>
+ <label id="errorContentLabel" class="icon-alert error" ng-if="newChangeManagement.configUpdateFile.$error.validateAsyncFn">{{vm.configUpdateContentError}}</label>
+ </div>
+ <div ng-if="vm.shouldShowVnfInPlaceFields()">
+ <div class="form-group">
+ <label class="control-label">operations-timeout</label>
+ <input class="form-control" ng-model="vm.changeManagement.operationTimeout" name="operationTimeout" type="text" id="operations-timeout" pattern="[0-9]+" required>
+ </div>
+ <div class="form-group">
+ <label class="control-label">existing-software-version</label>
+ <input class="form-control" ng-model="vm.changeManagement.existingSoftwareVersion" name="existingSoftwareVersion" type="text" id="existing-software-version" pattern="{{vm.softwareVersionRegex}}" required>
+ </div>
+ <div class="form-group">
+ <label class="control-label">new-software-version</label>
+ <input class="form-control" ng-model="vm.changeManagement.newSoftwareVersion" name="newSoftwareVersion" type="text" id="new-software-version" pattern="{{vm.softwareVersionRegex}}" required>
+ </div>
+
+ </div>
</div>
<div class="modal-footer">
<div class="pull-right">
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js
deleted file mode 100644
index c8f44c715..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.controller.js
+++ /dev/null
@@ -1,455 +0,0 @@
-(function () {
- 'use strict';
-
- appDS2.controller("newSchedulerController", ["$scope", "$uibModal", "$uibModalInstance", "AaiService", "SchedulerService", "_",
- "$log", "changeManagement", "$timeout", "$interval", "$filter", "VIDCONFIGURATION", "changeManagementService", newSchedulerController]);
-
- function newSchedulerController($scope, $uibModal, $uibModalInstance, AaiService, SchedulerService, _, $log, changeManagement, $timeout, $interval, $filter, VIDCONFIGURATION, changeManagementService) {
- var vm = this;
- var pollpromise;
-
- var init = function () {
- vm.scheduler = {};
- vm.schedulingInfo = {};
- var callbackData = extractChangeManagementCallbackDataStr(changeManagement);
- vm.vnfObject = changeManagement;
- vm.schedulerObj = {
- domain: 'ChangeManagement',
- scheduleId: '',
- scheduleName: 'VnfUpgrade/DWF',
- userId: '',
- domainData: [{
- 'WorkflowName': vm.scheduler.policy,
- 'CallbackUrl': 'http://127.0.0.1:8989/scheduler/v1/loopbacktest/vid',
- 'CallbackData': callbackData
- }],
-
- schedulingInfo: {
- normalDurationInSeconds: '',
- additionalDurationInSeconds: '',
- concurrencyLimit: '',
- policyId: '',
- vnfDetails: [
- {
- groupId: "",
- node: [],
- changeWindow: [{
- startTime: '',
- endTime: ''
- }]
-
- }
- ]
- },
-
- }
- vm.schedulerObj1 = {
- "domain": "ChangeManagement",
- "scheduleName": "VnfUpgrade/DWF",
- "userId": "su7376",
- "domainData": [
- {
- "WorkflowName": "HEAT Stack Software Update for vNFs",
- "CallbackUrl": "http://127.0.0.1:8989/scheduler/v1/loopbacktest/vid",
- "CallbackData": "testing"
- }
- ],
- "schedulingInfo": {
- "normalDurationInSeconds": 60,
- "additionalDurationInSeconds": 60,
- "concurrencyLimit": 60,
- "policyId": "SNIRO_CM_1707.Config_MS_Demo_TimeLimitAndVerticalTopology_zone_localTime.1.xml",
- "vnfDetails": [
- {
- "groupId": "group1",
- "node": ["satmo415vbc", "satmo455vbc"],
- "changeWindow": [
- {
- "startTime": "2017-08-08T16:37:30.521Z",
- "endTime": "2017-08-08T16:37:30.521Z"
- }
- ]
- }
- ]
- }
- };
-
-
- vm.format = 'yyyy/MM/dd';
- vm.todate = new Date();
- vm.checkboxSelection = 'false';
- vm.fromDate = '';
- vm.toDate = '';
- vm.timeSlots = [];
-
- vm.changeManagement = {};
-
- vm.subscribers = [];
-
- AaiService.getSubscribers(function (response) {
- vm.subscribers = response;
- });
-
- vm.serviceTypes = [];
- AaiService.getServices(function (response) {
- vm.serviceTypes = response.data.service;
- });
-
- changeManagementService.getWorkflows()
- .then(function (response) {
- vm.workflows = response.data;
- })
- .catch(function (error) {
- $log.error(error);
- });
-
- //TODO: Get the VNF names from backend dynamically
- vm.vnfNames = [];
-
- //TODO: Get the VNF types from backend dynamically
- vm.vnfTypes = [];
-
- AaiService.getLoggedInUserID(function (response) {
- vm.userID = response.data;
- });
- vm.policys = [];
-
- var policyName = JSON.stringify({
- policyName: "SNIRO_1710.*",
- configAttributes: {
- service: "PlacementOptimizationPolicy"
- }
- });
- SchedulerService.getPolicyInfo(policyName, function (response) {
- vm.policys = response.data.entity;
- });
- };
-
- vm.radioSelections = function (test) {
- if (vm.checkboxSelection == "true") {
- vm.fromDate = '';
- vm.toDate = ''
- }
- }
- vm.close = function () {
- $uibModalInstance.close();
- };
-
-
- function convertToSecs(number) {
- var totalSecs;
- if (vm.selectedOption === 'hours') {
- totalSecs = number * 3600;
-
- }
- else if (vm.selectedOption === 'minutes') {
- totalSecs = number * 60;
- } else {
- totalSecs = number;
- }
- return totalSecs;
- }
-
- vm.submit = function () {
- vm.schedulingInfo = {
- scheduleId: vm.schedulerID,
- approvalDateTime: '2017-08-08T16:37:30.521Z',
- approvalUserId: "sy6266",
- approvalStatus: 'Accepted',
- approvalType: 'Tier 2'
- };
-
- var approvalObj = JSON.stringify(vm.schedulingInfo);
- SchedulerService.getSubmitForapprovedTimeslots(approvalObj, function (response) {
- if (response.status == 200) {
- openConfirmationModal("Successfully Sent for Approval");
- }
-
- });
- };
-
- vm.reject = function () {
- vm.schedulingInfo = {
- scheduleId: vm.schedulerID,
- approvalDateTime: '2017-08-08T16:37:30.521Z',
- approvalUserId: "sy6266",
- approvalStatus: 'Rejected',
- approvalType: 'Tier 2'
- }
-
- var approvalObj = JSON.stringify(vm.schedulingInfo)
- SchedulerService.getSubmitForapprovedTimeslots(approvalObj, function (response) {
- if (response.status == 200) {
- openConfirmationModal("Successfully sent for Rejection");
- }
-
- });
- };
-
- vm.schedule = function (myForm) {
- $scope.$watch('fromDate', validateDates(myForm));
- $scope.$watch('toDate', validateDates(myForm));
- if (myForm.$valid) {
- sendSchedulerReq()
- }
- };
-
-
- function sendSchedulerReq() {
- var changeWindow = [{
- startTime: '',
- endTime: ''
- }];
- vm.timeSlots = [];
- var fromDate = $filter('date')(new Date(vm.fromDate), "yyyy-MM-ddTHH:mmZ", "UTC");
- var toDate = $filter('date')(new Date(vm.toDate), "yyyy-MM-ddTHH:mmZ", "UTC");
-
- changeWindow[0].startTime = fromDate;
- changeWindow[0].endTime = toDate;
- vm.schedulerObj.userId = vm.userID;
- vm.schedulerObj.domainData[0].WorkflowName = changeManagement.workflow;
- vm.schedulerObj.schedulingInfo.normalDurationInSeconds = convertToSecs(vm.scheduler.duration);
- vm.schedulerObj.schedulingInfo.additionalDurationInSeconds = convertToSecs(vm.scheduler.fallbackDuration);
- vm.schedulerObj.schedulingInfo.concurrencyLimit = vm.scheduler.concurrency;
- vm.schedulerObj.schedulingInfo.policyId = vm.scheduler.policy.policyName;
- vm.schedulerObj.schedulingInfo['vnfDetails'][0].groupId = 'groupId';
- vm.schedulerObj.schedulingInfo['vnfDetails'][0].node = getVnfData(changeManagement.vnfNames);
-
- vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow = changeWindow;
- if (vm.checkboxSelection == "true") { //When Scheduled now we remove the changeWindow
- delete vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow;
- }
- vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow = changeWindow;
- delete vm.schedulerObj.schedulingInfo['vnfDetails'][0].changeWindow;
-
- var requestScheduler = JSON.stringify(vm.schedulerObj);
- console.log(requestScheduler);
- SchedulerService.getStatusSchedulerId(requestScheduler, function (response) {
- vm.schedulerID = response.data.uuid;
- vm.isSpinnerVisible = true;
- if (vm.schedulerID) {
- var scheduledID = JSON.stringify({scheduleId: vm.schedulerID});
- seviceCallToGetTimeSlots();
- }
- });
- }
-
- function seviceCallToGetTimeSlots() {
-
- SchedulerService.getTimeSotsForSchedulerId(vm.schedulerID, function (response) {
- if (vm.checkboxSelection == "false") {
- if (response.data.entity.schedule) {
- var scheduleColl = JSON.parse(response.data.entity.schedule);
- if (scheduleColl.length > 0) {
- vm.timeSlots = scheduleColl;
- vm.isSpinnerVisible = false;
- hasvaluereturnd = false;
- $scope.stopPoll();
- openConfirmationModal(response.data.entity.scheduleId + " Successfully Returned TimeSlots.");
- }
-
- }
- else {
- if (vm.timeSlots.length == 0 && hasthresholdreached == false) {
- var polltime = VIDCONFIGURATION.SCHEDULER_POLLING_INTERVAL_MSECS;
- pollpromise = poll(polltime, function () {
- if (vm.timeSlots.length == 0) {
- hasvaluereturnd = true;
- seviceCallToGetTimeSlots()
- }
- else {
- hasvaluereturnd = false;
- }
-
- });
-
- } else {
- openConfirmationModal("Timeout error.")
- }
- }
-
- }
- else {
- if (response.data.entity) {
- vm.isSpinnerVisible = false;
- openConfirmationModal(response.data.entity.scheduleId + " Successfully Ready for Schedule.")
- }
- }
-
- });
-
- }
-
- function openConfirmationModal(jobInfo) {
- var modalInstance = $uibModal.open({
- templateUrl: 'app/vid/scripts/modals/alert-new-scheduler/alert-new-scheduler.html',
- controller: 'alertNewSchedulerController',
- controllerAs: 'vm',
- resolve: {
- jobInfo: function () {
- return jobInfo;
- }
- }
- });
- }
-
- var hasvaluereturnd = true; // Flag to check
- var hasthresholdreached = false;
- var thresholdvalue = VIDCONFIGURATION.SCHEDULER_MAX_POLLS; // interval threshold value
-
- function poll(interval, callback) {
- return $interval(function () {
- if (hasvaluereturnd) { //check flag before start new call
- callback(hasvaluereturnd);
- }
-
- thresholdvalue = thresholdvalue - 1; //Decrease threshold value
- if (thresholdvalue == 0) {
- $scope.stopPoll(); // Stop $interval if it reaches to threshold
- }
- }, interval)
- }
-
-
-// stop interval.
- $scope.stopPoll = function () {
- $interval.cancel(pollpromise);
- thresholdvalue = 0; //reset all flags.
- hasvaluereturnd = false;
- hasthresholdreached = true;
- vm.isSpinnerVisible = false;
- }
-
- function getVnfData(arrColl) {
- var vnfcolletion = [];
-
- for (var i = 0; i < arrColl.length; i++) {
- vnfcolletion.push(arrColl[i].name);
- }
-
- return vnfcolletion
- }
-
- function validateDates(form) {
- if (vm.checkboxSelection == "false") {
-
- if (form.startDate.$error.invalidDate || form.endDate.$error.invalidDate) {
- form.startDate.$setValidity("endBeforeStart", true); //already invalid (per validDate directive)
- } else {
- //depending on whether the user used the date picker or typed it, this will be different (text or date type).
- //creating a new date object takes care of that.
- var endDate = new Date(vm.toDate);
- var startDate = new Date(vm.fromDate);
- form.startDate.$setValidity("endBeforeStart", endDate >= startDate);
- }
- }
- }
-
-
- function extractChangeManagementCallbackDataStr(changeManagement) {
- var result = {};
-
- result.requestType = changeManagement.workflow;
- result.requestDetails = [];
-
- _.forEach(changeManagement.vnfNames, function (vnf) {
-
- var data = {
- vnfName: vnf.name,
- vnfInstanceId: vnf.id,
- modelInfo: {
- modelType: 'vnf',
- modelInvariantId: vnf.properties['model-invariant-id'],
- modelVersionId: vnf.modelVersionId,
- modelName: vnf.properties['vnf-name'],
- modelVersion: vnf.version,
- modelCustomizationName: vnf.properties['model-customization-name'],
- modelCustomizationId: vnf.properties['model-customization-id']
- },
- cloudConfiguration: {
- lcpCloudRegionId: vnf.availableVersions[0].cloudConfiguration.lcpCloudRegionId,
- tenantId: vnf.availableVersions[0].cloudConfiguration.tenantId
- },
- requestInfo: {
- source: vnf.availableVersions[0].requestInfo.source,
- suppressRollback: vnf.availableVersions[0].requestInfo.suppressRollback,
- requestorId: vnf.availableVersions[0].requestInfo.requestorId
- },
- relatedInstanceList: [],
- requestParameters: {
- usePreload: vnf.availableVersions[0].requestParameters.usePreload
- }
- };
-
- var serviceInstanceId = '';
- _.forEach(vnf['service-instance-node'], function (instanceNode) {
- if(instanceNode['node-type'] === 'service-instance'){
- serviceInstanceId = instanceNode.properties['service-instance-id'];
- }
- });
-
-
- _.forEach(vnf.availableVersions[0].relatedInstanceList, function (related) {
-
- var rel = related.relatedInstance;
-
- var relatedInstance = {
- instanceId: serviceInstanceId,
- modelInfo: {
- modelType: rel.modelInfo.modelType,
- modelInvariantId: rel.modelInfo.modelInvariantId,
- modelVersionId: rel.modelInfo.modelVersionId,
- modelName: rel.modelInfo.modelName,
- modelVersion: rel.modelInfo.modelVersion,
- modelCustomizationName: rel.modelInfo.modelCustomizationName,
- modelCustomizationId: rel.modelInfo.modelCustomizationId
- }
- };
-
- if (rel.vnfInstanceId)
- relatedInstance.instanceId = rel.vnfInstanceId;
-
- data.relatedInstanceList.push({relatedInstance: relatedInstance});
- });
-
-
- result.requestDetails.push(data);
- }
- );
-
-
- // _.forEach(changeManagement.vnfNames, function (vnfName) {
- // if (vnfName && vnfName.version) {
- // if (vnfName.selectedFile) {
- // vnfName.version.requestParameters.userParams = vnfName.selectedFile;
- // }
- // result.requestDetails.push(vnfName.version)
- // }
- // });
-
- return JSON.stringify(result);
- }
-
- init();
- };
-
- appDS2.directive('validDate', function () {
- return {
- restrict: 'A',
- require: 'ngModel',
- link: function (scope, element, attrs, control) {
- control.$parsers.push(function (viewValue) {
- var newDate = model.$viewValue;
- control.$setValidity("invalidDate", true);
- if (typeof newDate === "object" || newDate == "") return newDate; // pass through if we clicked date from popup
- if (!newDate.match(/^\d{1,2}\/\d{1,2}\/((\d{2})|(\d{4}))$/))
- control.$setValidity("invalidDate", false);
- return viewValue;
- });
- }
- };
- })
-
-
-})();
-
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css
deleted file mode 100644
index 8da5c55c5..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.css
+++ /dev/null
@@ -1,145 +0,0 @@
-.btn-white {
- font-family: OpenSans;
- border-radius: 2px;
- border: 1px solid #d8d8d8;
- background-color: #ffffff;
- width: 94px;
- height: 30px;
- color: #5a5a5a;
- font-size: 13px;
- font-weight: 400;
- line-height: 36px;
- text-align: center;
-}
-
-.btn-primary {
- font-family: OpenSans;
- border-radius: 2px;
- border: 1px solid #0091c8;
- background-color: #009fdb;
- width: 94px;
- height: 30px;
- color: #ffffff;
- font-size: 13px;
- font-weight: 400;
- line-height: 36px;
- text-align: center;
-}
-
-.modal-header {
- border: none!important;
- padding: 15px 15px 0px 15px!important;
-}
-
-.modal-header h3 {
- font-family: OpenSans;
- color: #5a5a5a;
- font-size: 22px;
- font-weight: 300;
- line-height: 16px;
- padding-bottom: 20px;
- border-bottom: 3px solid #009fdb;
-
-}
-
-.modal-footer {
- background-color: #eaeaea;
-}
-
-.modal-dialog {
- width: 587px;
- border-radius: 8px;
-}
-
-.modal-content {
- width: 587px;
- border-radius: 8px;
- background-color: #ffffff;
-}
-.label-font{
- font-size: 1em;
-}
-.calender-icon{
- background-image: url(../../../../../app/fusion/external/ebz/images/Calendar.svg);
- background-repeat:no-repeat;
- background-position:98%;
- border-radius: 6px;
- border: 1px solid #888;
- color: #444;
- font-family: clearview_att_regular;
- width: 100%;
- outline: 0;
- padding: 7px 10px;
- text-transform: none;
- z-index: 0;
- height: 40px;
- position: relative;
-
-}
-
-input.calender-icon:focus{
- background-image: url(../../../../../app/fusion/external/ebz/images/Calendar_blue.svg);
- background-repeat:no-repeat;
-}
-
-
-
-.timeslots-content{
- margin-top: 0px;
- margin-bottom: 0px;
- height: 10em;
-}
-.find-block{
- float:5em;
-}
-.timeslots-block{
-/* margin-top: 1em; */
- height: 85px;
- }
- .policy-combo{
- background-image: none;
- }
-
- div[ng-controller=newSchedulerController] .schedulerVisible {
- visibility: visible;
-}
-div[ng-controller=newSchedulerController] .schedulerHidden {
- visibility: hidden;
-}
-
-.table {
- border: 1px solid #eaeaea;
- box-sizing: border-box;
- background-color: #ffffff;
- box-shadow: 0px 2px 7px 0px rgba(34, 31, 31, 0.17);
- font-family: OpenSans;
- color: #5a5a5a;
- font-size: 14px;
- font-weight: 400;
-}
-.table>thead {
- background-color: #d2d2d2;
- font-family: OpenSans;
- color: #191919;
- font-size: 13px;
- font-weight: 600;
- line-height: 40px;
-}
-
-.table-headline-row {
- font-family: OpenSans;
- color: #5a5a5a;
- font-size: 14px;
- font-weight: 600;
- background-color: #eaeaea;
- box-shadow: 0px 1px 1px 0px rgba(34, 31, 31, 0.19);
-}
-
-.table-bordered{border:1px solid #eaeaea;}
-.table-bordered>tbody>tr>td,
-.table-bordered>tbody>tr>th,
-.table-bordered>tfoot>tr>td,
-.table-bordered>tfoot>tr>th,
-.table-bordered>thead>tr>td,
-.table-bordered>thead>tr>th{border:1px solid #eaeaea;}
-
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html
deleted file mode 100644
index 498ff2ec4..000000000
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-scheduler/new-scheduler.html
+++ /dev/null
@@ -1,101 +0,0 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-scheduler/new-scheduler.css" />
-<div class="modal-header">
- <h3 class="modal-title" id="modal-title">Scheduler Change</h3>
-</div>
-<form name="newschedulermodalForm" ng-submit="vm.schedule(newschedulermodalForm)">
- <div class="modal-body">
-
- <div class="form-group" >
- <label><input type="radio" ng-model="vm.checkboxSelection" ng-change="vm.radioSelections()" value="true">Now</label>
- <label><input type="radio" ng-model="vm.checkboxSelection" ng-change="vm.radioSelections()" value="false">Range</label>
- </div>
-<!-- <div class="form-group"> -->
-<!-- <input type="radio" ng-model="checkboxSelection" value="false" ><label>Range</label> -->
-<!-- </div> -->
-
-
- <div class="form-group" >
- <label class="control-label">From Date</label>
- <input ng-disabled="(vm.checkboxSelection=='true')? true:false" valid-date name="startDate" ng-model="vm.fromDate" id="startDate" datetime-picker ng-required="false" hour="23" minute='59' class="calender-icon"/>
-
- </div>
- <div class="form-group" >
- <label class="control-label">To Date</label>
- <input ng-disabled="(vm.checkboxSelection=='true')? true:false" valid-date name="endDate" ng-model="vm.toDate" id="endDate" datetime-picker ng-required="false" hour="23" minute='59' class="calender-icon" />
- <span ng-show="newschedulermodalForm.startDate.$error.endBeforeStart">To date must be on or after From date.</span>
- <span ng-show="newschedulermodalForm.startDate.$error.invalidDate || newschedulermodalForm.endDate.$error.invalidDate">Check dates for validity</span>
- <span ng-show="newschedulermodalForm.startDate.$error.required || newschedulermodalForm.endDate.$error.required">A required date is missing</span>
- </div>
-
- <div class="form-group" >
- <label>Please Select Option For Duration and FallBack</label>
-
- <select class="form-control" name="selecttime" data-tests-id="timeUnitSelect" ng-model="vm.selectedOption" ng-change="vm.updateMinMax()">
- <option value="hours">HOURS</option>
- <option value="minutes">MINUTES</option>
- <option value="seconds">SECONDS</option>
- </select>
- </div>
- <div class="row">
- <div class="form-group col-md-6 col-xs-12">
- <label class="control-label">Duration</label>
- <input type="number" style="font-size: 1em;" data-tests-id="durationInput" name="durationinput" ng-model="vm.scheduler.duration" ng-required="true">
-
- </div>
- <div class="form-group col-md-6 col-xs-12" >
- <label class="control-label">Fallback Duration</label>
- <input type="number" style="font-size: 1em;" name="fallbackinput" data-tests-id="fallbackInput" ng-model="vm.scheduler.fallbackDuration" ng-required="true">
-
-
- </div>
- </div>
- <div class="form-group">
- <label class="control-label">Concurrency Limit</label>
- <input type="number" style="font-size: 1em;" name="input" data-tests-id="concurrencyLimitInput" ng-model="vm.scheduler.concurrency" min="1" max="30" ng-required="true">
- </div>
- <div class="form-group">
- <label class="control-label">Policy</label>
- <select class="policy-combo" ng-model="vm.scheduler.policy" id="policy" ng-options="item.policyName for item in vm.policys">
- <option value="">Select Policy</option>
- </select>
- </div>
- <div class="form-group">
- <button type="submit" id="find" name="Find" ng-disabled="vm.isClicked" class="btn btn-primary find-block">Find</button>
- <span class="spinner" ng-show="vm.isSpinnerVisible">
- <img src="app/vid/images/spinner.gif">
- </img>
-
- </span>
-
- </div>
-
- <div class="form-group" ng-show="(vm.checkboxSelection=='false')? true:false">
-<!-- <label class="control-label">Time Slots</label> -->
-<!-- <textarea rows="10" cols="50" class="timeslots-block" ></textarea> -->
- <table class="table table-bordered">
- <thead class="thead-default">
- <tr>
- <th>Start Time</th>
- <th>End Time</th>
- </tr>
- </thead>
- <tbody>
-
- <tr class="table-headline-row" ng-repeat="timeslot in vm.timeSlots">
- <td>{{timeslot.startTime}}</td>
- <td>{{timeslot.finishTime}}</td>
- </tr>
- </tbody>
- </table>
- </div>
-
- </div>
- <div class="modal-footer">
- <div class="pull-right">
- <button type="button" id="btn" name="submit" class="btn btn-primary" ng-click="vm.submit()">Schedule</button>
- <button type="button" id="btn" name="submit" class="btn btn-primary" ng-click="vm.reject()">Reject</button>
- <button type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
- </div>
- </div>
-</form>
-
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js
new file mode 100644
index 000000000..daec9b2e9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.controller.js
@@ -0,0 +1,65 @@
+(function () {
+ 'use strict';
+
+ appDS2.controller("newTestEnvironmentModalController", ["$uibModalInstance", "$uibModal", "AaiService", "TestEnvironmentsService","OwningEntityService",
+ "$log", "$scope", "_", "COMPONENT","$rootScope", newTestEnvironmentsModalController]);
+
+ function newTestEnvironmentsModalController($uibModalInstance, $uibModal, AaiService, TestEnvironmentsService,OwningEntityService, $log, $scope, _, COMPONENT, $rootScope) {
+ var vm = this;
+ vm.newEnvironment = {};
+
+ var init = function () {
+ vm.newEnvironment.operationalEnvironmentType = "VNF";
+ loadCategoryParameters();
+ loadEcompEnvironmentsList();
+ };
+
+ var loadEcompEnvironmentsList = function () {
+ TestEnvironmentsService.loadAAIestEnvironments("ECOMP")
+ .then(function(response) {
+ vm.environments = response.operationalEnvironment;
+ })
+ .catch(function (error) {
+ vm.aaiConnectError = error.message;
+ $log.error(error);
+ });
+ };
+
+ var loadCategoryParameters = function () {
+ OwningEntityService.getOwningEntityProperties(function(response){
+ vm.environmentsTypesList = response["operational-environment-type"].map(function (x){
+ return x.name;});
+ vm.workloadContextList = response["workload-context"].map(function (x){
+ return x.name;});
+ },COMPONENT.TENANT_ISOLATION_FAMILY);
+ }
+
+
+ vm.setEcompEnvironment = function (selectedIndex) {
+ var ecompEnvironment = vm.environments[selectedIndex];
+ vm.newEnvironment.ecompInstanceId = ecompEnvironment.operationalEnvironmentId;
+ vm.newEnvironment.ecompInstanceName = ecompEnvironment.operationalEnvironmentName;
+ vm.newEnvironment.tenantContext = ecompEnvironment.tenantContext;
+ };
+
+ vm.close = function () {
+ $uibModalInstance.close();
+ };
+
+ vm.createEnvironment = function () {
+ if($scope.newTestEnvironment.$valid) {
+ vm.newEnvironment.workloadContext = vm.newEnvironment.operationalEnvironmentType + '_' + vm.newEnvironment.workloadContext;
+ var requestDetails = vm.newEnvironment;
+ $rootScope.$broadcast(COMPONENT.MSO_CREATE_ENVIRONMENT, {
+ url : COMPONENT.OPERATIONAL_ENVIRONMENT_CREATE,
+ requestDetails : requestDetails
+ });
+ vm.close();
+ }
+ };
+
+
+
+ init();
+ }
+})(); \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html
new file mode 100644
index 000000000..cd14a76cb
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/new-test-environment/new-test-environment.html
@@ -0,0 +1,50 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
+<div class="modal-header">
+ <h3 class="modal-title" id="modal-title">New Test Environment</h3>
+ <span ng-click="vm.close()" class="pull-right modal-close" aria-hidden="true">&times;</span>
+</div>
+<form class="form-create" data-tests-id="test-new-environment-form" name="newTestEnvironment" ng-submit="vm.createEnvironment()">
+ <div class="modal-body">
+ <div class="form-group">
+ <label class="control-label" for="environmentName">Environment Name</label>
+ <input id="environmentName" class="form-control" ng-model="vm.newEnvironment.instanceName" name="instanceName" data-tests-id="environment-name" placeholder="Enter environment name" required>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="ecompInstanceId">ECOMP Environment ID</label>
+ <select class="form-control" ng-class="{'grayedOut': !selectedIndex, 'connect-error': vm.aaiConnectError}" ng-model="selectedIndex" name="ecompInstanceId" id="ecompInstanceId" data-tests-id="ecomp-instance-id" required ng-change="vm.setEcompEnvironment(selectedIndex)">
+ <option value="" disabled selected hidden>Select environment ID</option>
+ <option data-tests-id="environment-id-option" class="environmentIdOption" ng-repeat="item in vm.environments" ng-value="$index">{{item.operationalEnvironmentId}}</option>
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="ecompInstanceName">ECOMP Environment Name</label>
+ <input id="ecompInstanceName" class="form-control" ng-model="vm.newEnvironment.ecompInstanceName" name="ecompInstanceName" data-tests-id="ecomp-instance-name" required disabled>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="tenantContext">Select VSP</label>
+ <input id="tenantContext" class="form-control" ng-model="vm.newEnvironment.tenantContext" name="tenantContext" data-tests-id="tenant-context" required disabled>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="operationalEnvironmentType">Environment Type</label>
+ <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.operationalEnvironmentType}" ng-model="vm.newEnvironment.operationalEnvironmentType" name="operationalEnvironmentType" id="operationalEnvironmentType" data-tests-id="operational-environment-type" required>
+ <option value="" disabled selected hidden>Enter environment type</option>
+ <option data-tests-id="environment-type-option" class="environmentTypeOption" ng-repeat="item in vm.environmentsTypesList" ng-value="item">{{item}}</option>
+ </select>
+ </div>
+ <div class="form-group">
+ <label class="control-label" for="workloadContext">Workload Context</label>
+ <select class="form-control" ng-class="{'grayedOut': !vm.newEnvironment.workloadContext}" ng-model="vm.newEnvironment.workloadContext" name="workloadContext" id="workloadContext" data-tests-id="workload-context" required>
+ <option value="" disabled selected hidden>Select workload context</option>
+ <option data-tests-id="workload-context-option" class="workloadContextOption" ng-repeat="item in vm.workloadContextList" ng-value="item">{{vm.newEnvironment.operationalEnvironmentType + '_' + item}}</option>
+ </select>
+ </div>
+ <div data-tests-id="test-new-environment-error" class="connect-error" ng-if="vm.aaiConnectError">{{vm.aaiConnectError}}</div>
+ </div>
+ <div class="modal-footer">
+ <div class="pull-right">
+ <button data-tests-id="submit-button" type="submit" id="submit" name="submit" class="btn btn-primary" data-ng-disabled="newTestEnvironment.$invalid">Create</button>
+ <button data-tests-id="cancel-button" type="button" id="cancel" name="cancel" class="btn btn-white" ng-click="vm.close()">Cancel</button>
+ </div>
+ </div>
+</form>
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html
index 911e86c24..59c30c54d 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/pending-change-management/pending-change-management.html
@@ -1,4 +1,4 @@
-<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/new-change-management/new-change-management.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/modal-create-new.css" />
<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/pending-change-management/pending-change-management.css" />
<div class="modal-header">
<h3 class="modal-title" id="pending-modal-header">Pending</h3>
@@ -8,5 +8,5 @@
<span id="pending-modal-content">{{vm.content}}</span>
</div>
<div class="modal-footer">
- <div ng-include="'app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html'"></div>
+ <!--<div ng-include="'app/vid/scripts/modals/change-management-manual-tasks-controller/change-management-manual-tasks.html'"></div>-->
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css
new file mode 100644
index 000000000..2c7f3a106
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.css
@@ -0,0 +1,37 @@
+.modal-dialog * {
+ font-family: OpenSans-Regular, sans-serif;
+}
+.modal-dialog {
+ width: 540px;
+}
+.modal-dialog service-metadata{
+ background: white;
+}
+.modal-dialog .modal-footer {
+ background: #F8F8F8;
+ border-radius: 0 0 8px 8px;
+}
+.modal-dialog .cancel-btn {
+ width: 120px;
+}
+.modal-dialog .title {
+ font-size: 22px;
+ color: #000000;
+}
+.modal-dialog .top {
+ margin: 15px 20px;
+ border-bottom: 3px solid #009FDB;
+ padding-bottom: 15px;
+}
+.modal-dialog .modal-x {
+ float: right;
+ margin-top: 10px;
+ height: 15px;
+ cursor:pointer;
+}
+.modal-dialog service-metadata label {
+ margin-bottom: 3px;
+}
+.modal-dialog service-metadata .field {
+ margin-top: 11px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html
new file mode 100644
index 000000000..47ed3e424
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/modals/service-metadata/service-metadata.html
@@ -0,0 +1,12 @@
+<link rel="stylesheet" type="text/css" href="app/vid/scripts/modals/service-metadata/service-metadata.css"/>
+<div class="top">
+ <span class="title">{{selectedMetadata[0].value}}</span>
+ <span class="top-btn sprite modal-x" data-ng-click="cancel()"></span>
+</div>
+
+<div class="meatadata-modal-body" id="modal-body">
+ <service-metadata service-metadata-fields="selectedMetadata"></service-metadata>
+</div>
+<div class="modal-footer">
+ <button class="cancel-btn grey" data-tests-id="cancel" data-ng-click="cancel()">Close</button>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceFactory.java b/vid-app-common/src/main/webapp/app/vid/scripts/services/OwningEntityService.js
index ab12c7b14..ef48aa939 100755..100644
--- a/vid-app-common/src/main/java/org/openecomp/vid/mso/MsoRestInterfaceFactory.java
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/OwningEntityService.js
@@ -1,44 +1,40 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-package org.openecomp.vid.mso;
-
-import org.openecomp.portalsdk.core.util.SystemProperties;
-import org.openecomp.vid.mso.rest.MsoRestClientNew;
-
-/**
- * A factory for creating MsoRestInterface objects.
- */
-public class MsoRestInterfaceFactory {
-
- /**
- * Gets the single instance of MsoRestInterfaceFactory.
- *
- * @return single instance of MsoRestInterfaceFactory
- */
- public static MsoInterface getInstance() {
- String msoPropertyName = "mso.client.type";
- if (SystemProperties.containsProperty(msoPropertyName) &&
- SystemProperties.getProperty(msoPropertyName).equals("LOCAL")) {
- return new MsoLocalClientNew();
- } else
- return new MsoRestClientNew();
- }
-}
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var OwningEntityService = function ($http, $log, PropertyService, UtilityService, COMPONENT) {
+ return {
+ getOwningEntityProperties: function ( successCallbackFunction, familyName) {
+ $log.debug("OwningEntityService:getOwningEntityProperties");
+ familyName = familyName || COMPONENT.PARAMETER_STANDARDIZATION_FAMILY;
+ var url = COMPONENT.GET_CATEGORY_PARAMETERS+"?familyName=" + familyName+ "&r=" + Math.random();
+ var config = { timeout: PropertyService.getServerResponseTimeoutMsec() };
+
+ $http.get(url, config)
+ .then(function (response) {
+ successCallbackFunction(response.data.categoryParameters);
+ }).catch(UtilityService.runHttpErrorHandler);
+ }
+ }
+};
+
+appDS2.factory("OwningEntityService", ["$http", "$log", "PropertyService",
+ "UtilityService", "COMPONENT", "FIELD", OwningEntityService]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
index a10f602bf..53a941bfb 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/aaiService.js
@@ -21,6 +21,70 @@
"use strict";
var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONENT, FIELD, $q) {
+
+ function getServiceInstance(serviceInstanceIdentifier, findBy) {
+ serviceInstanceIdentifier.trim();
+
+ return $http.get(COMPONENT.AAI_GET_SERVICE_INSTANCE_PATH + serviceInstanceIdentifier + "/" + findBy + "?r=" + Math.random(), {}, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ });
+ }
+
+ function getPnfByName(pnfName) {
+ var deferred = $q.defer();
+ var url = COMPONENT.AAI_GET_PNF_BY_NAME+ encodeURIComponent(pnfName) ;
+ var config = { timeout: PropertyService.getServerResponseTimeoutMsec() };
+
+ $http.get(url, config)
+ .success(function (response) {
+ deferred.resolve({data: response});
+ })
+ .error(function(data, status, headers, config) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
+ };
+
+
+ function getGlobalCustomerIdFromServiceInstanceResponse(response) {
+ var globalCustomerId = "";
+ if (angular.isArray(response.data[FIELD.ID.RESULT_DATA])) {
+ var customerIndex = 5;
+ var customerIdIndex = 6;
+ var itemIndex = 0;
+
+ var item = response.data[FIELD.ID.RESULT_DATA][itemIndex];
+ var url = item[FIELD.ID.RESOURCE_LINK];
+ var urlParts = url.split("/");
+ if (urlParts[customerIndex] === FIELD.ID.CUSTOMER) {
+ globalCustomerId = urlParts[customerIdIndex];
+ }
+ }
+ return globalCustomerId;
+ }
+
+ function searchServiceInstances(query) {
+ return $http.get( COMPONENT.SEARCH_SERVICE_INSTANCES + query, {}, {
+ timeout : PropertyService.getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ var displayData = response.data[FIELD.ID.SERVICE_INSTANCES];
+ if (!displayData.length) {
+ displayData = [{
+ globalCustomerId : null,
+ subscriberName : null,
+ serviceType : FIELD.PROMPT.NO_SERVICE_SUB,
+ serviceInstanceId : FIELD.PROMPT.NO_SERVICE_INSTANCE
+ }];
+ }
+ return {displayData: displayData};
+ })
+ }
+
+ function getJoinedQueryString(queries) {
+ return queries.filter(function (val) {return val;}).join("&");
+ }
+
return {
getSubscriberName : function(globalCustomerId,
successCallbackFunction) {
@@ -34,16 +98,16 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
timeout : PropertyService
.getServerResponseTimeoutMsec()
}).then(function(response) {
- var subName = "";
+ var result = {};
if (response.data) {
- subName = response.data[FIELD.ID.SUBNAME];
+ result.subscriberName = response.data[FIELD.ID.SUBNAME];
+ result.serviceSubscriptions = response.data[FIELD.ID.SERVICE_SUBSCRIPTIONS];
}
- successCallbackFunction(subName);
+ successCallbackFunction(result);
})["catch"]
(UtilityService.runHttpErrorHandler);
},
-
runNamedQuery : function (namedQueryId, globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
var url = COMPONENT.AAI_SUB_VIEWEDIT_PATH +
@@ -86,6 +150,48 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
});
},
+ getPNFInformationByServiceTypeAndId : function (globalCustomerId, serviceType, serviceInstanceId, successCallback, errorCallback) {
+
+ var url = COMPONENT.AAI_GET_PNF_INSTANCE +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(globalCustomerId) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceType) +
+ COMPONENT.FORWARD_SLASH + encodeURIComponent(serviceInstanceId);
+ $http.get(url, {}, {
+ timeout : PropertyService.getServerResponseTimeoutMsec()
+ }).then(function(response) {
+ if (response.data != null) {
+ successCallback(response);
+ } else {
+ errorCallback(response);
+ }
+ }, function(response) {
+ errorCallback(response);
+ });
+ },
+
+ searchServiceInstances: searchServiceInstances,
+
+ getModelVersionId: function (subscriberId, instanceId) {
+ var globalCustomerIdQuery = COMPONENT.SELECTED_SUBSCRIBER_SUB_PATH + subscriberId;
+ var serviceInstanceQuery = COMPONENT.SELECTED_SERVICE_INSTANCE_SUB_PATH + instanceId;
+
+ var query = "?" + getJoinedQueryString([globalCustomerIdQuery, serviceInstanceQuery]);
+
+ var deferred = $q.defer();
+
+ searchServiceInstances(query).then(function (response) {
+ var displayData = response.displayData;
+ if (displayData[0] && displayData[0].aaiModelVersionId) {
+ deferred.resolve(displayData[0].aaiModelVersionId);
+ } else {
+ deferred.reject(FIELD.ERROR.MODEL_VERSION_ID_MISSING);
+ }
+ }).catch(function (err) {
+ deferred.reject(err);
+ });
+
+ return deferred.promise;
+ },
getSubDetails : function(selectedSubscriber, selectedServiceInstance, successCallback, errorCallback) {
var subscriber;
@@ -124,9 +230,7 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
}
});
} else {
- if (serviceInstanceId == []) {
- serviceInstanceId = [ FIELD.PROMPT.NO_SERVICE_INSTANCE ];
- }
+ serviceInstanceId = [ FIELD.PROMPT.NO_SERVICE_INSTANCE ];
}
angular.forEach(serviceInstanceId, function(subVal, subKey) {
displayData.push({
@@ -145,7 +249,7 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
} else {
displayData.push({
globalCustomerId : selectedSubscriber,
- subscriberName : selectedSubscriberName,
+ subscriberName : subscriberName,
serviceType : FIELD.PROMPT.NO_SERVICE_SUB,
serviceInstanceId : FIELD.PROMPT.NO_SERVICE_INSTANCE
});
@@ -178,6 +282,26 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
});
},
+ getServiceInstance : getServiceInstance,
+ getPnfByName : getPnfByName,
+
+ getGlobalCustomerIdByInstanceIdentifier : function(serviceInstanceIdentifier, findBy) {
+ serviceInstanceIdentifier.trim();
+
+ return getServiceInstance(serviceInstanceIdentifier, findBy)
+ .then(function (response) {
+ return getGlobalCustomerIdFromServiceInstanceResponse(response);
+ });
+ },
+
+ getMultipleValueParamQueryString: function(values, paramSubPath) {
+ if (values.length) {
+ return paramSubPath + values.filter(function (val) {return val;}).join("&" + paramSubPath);
+ }
+ },
+
+ getJoinedQueryString: getJoinedQueryString,
+
getServices2 : function(successCallback, errorCallback ) {
$http.get( FIELD.ID.AAI_GET_SERVICES, {}, {
@@ -252,12 +376,6 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
var lcpCloudRegionTenants = [];
var aaiLcpCloudRegionTenants = response.data;
- lcpCloudRegionTenants.push({
- "cloudRegionId": "",
- "tenantName": FIELD.PROMPT.REGION,
- "tenantId": ""
- });
-
for (var i = 0; i < aaiLcpCloudRegionTenants.length; i++) {
lcpCloudRegionTenants.push({
"cloudRegionId": aaiLcpCloudRegionTenants[i][COMPONENT.CLOUD_REGION_ID],
@@ -267,8 +385,9 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
}
successCallbackFunction(lcpCloudRegionTenants);
- })["catch"]
- (UtilityService.runHttpErrorHandler);
+ }).catch(function(error) {
+ (UtilityService.runHttpErrorHandler(error.data, error.status));
+ })
},
getSubscribers : function(successCallbackFunction) {
$log
@@ -306,7 +425,7 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
})["catch"]
(UtilityService.runHttpErrorHandler);
},
- getLoggedInUserID : function(successCallbackFunction) {
+ getLoggedInUserID : function(successCallbackFunction, catchCallbackFunction) {
$log
.debug("AaiService:getLoggedInUserID");
var url = COMPONENT.GET_USER_ID;
@@ -325,6 +444,9 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
successCallbackFunction([]);
}
},function(failure){console.log("failure")})["catch"]
+ if(catchCallbackFunction) {
+ catchCallbackFunction();
+ }
(UtilityService.runHttpErrorHandler);
},
getServices : function(successCallbackFunction) {
@@ -459,6 +581,8 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
return deferred.promise;
},
+
+
getSubscriberServiceTypes: function(subscriberUuid) {
var deferred = $q.defer();
$log.debug("AaiService:getSubscriberServiceTypes: subscriberUuid: " + subscriberUuid);
@@ -477,6 +601,61 @@ var AaiService = function ($http, $log, PropertyService, UtilityService, COMPONE
}
return deferred.promise;
+ },
+ getVnfInstancesList: function(globalSubscriberId, serviceType, modelVersionId ,modelInvariantId, cloudRegionId) {
+ var deferred = $q.defer();
+ $http.get([COMPONENT.AAI_GET_VNF_INSTANCES_LIST,
+ globalSubscriberId,
+ serviceType,
+ modelVersionId,
+ modelInvariantId,
+ cloudRegionId]
+ .join(COMPONENT.FORWARD_SLASH))
+ .success(function (response) {
+ deferred.resolve(response);
+ }).error(function (data, status) {
+ deferred.reject({message: data, status: status});
+ });
+ return deferred.promise;
+ },
+ getPnfInstancesList: function (globalCustomerId, serviceType, modelVersionId, modelInvariantId, cloudRegionId, equipVendor, equipModel) {
+ var deferred = $q.defer();
+ $http.get([COMPONENT.AAI_GET_PNF_INSTANCES_LIST,
+ globalCustomerId, serviceType,
+ modelVersionId, modelInvariantId,
+ cloudRegionId,
+ equipVendor, equipModel
+ ].join(COMPONENT.FORWARD_SLASH))
+ .success(function (response) {
+ deferred.resolve(response);
+ }).error(function (data, status) {
+ deferred.reject({message: data, status: status});
+ });
+ return deferred.promise;
+ },
+ getByUri: function(uri) {
+ var deferred = $q.defer();
+
+ $http.get(COMPONENT.AAI_GET_BY_URI + uri)
+ .success(function (response) {
+ deferred.resolve({data: []});
+ }).error(function (data, status, headers, config) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
+ },
+ getConfiguration: function(configurationId) {
+ var deferred = $q.defer();
+
+ $http.get(COMPONENT.AAI_GET_CONFIGURATION + configurationId)
+ .success(function (response) {
+ deferred.resolve({data: []});
+ }).error(function (data, status, headers, config) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
}
}};
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
index f2282d69a..fdab6564b 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/change-management.service.js
@@ -5,16 +5,20 @@
function changeManagementService($http, $q, COMPONENT, VIDCONFIGURATION) {
this.getWorkflows = function (vnfs) {
- var deferred = $q.defer();
-
- $http.get(COMPONENT.GET_WORKFLOW.replace("@vnfs", vnfs))
- .success(function (response) {
- deferred.resolve({data: response});
- }).error(function (data, status, headers, config) {
- deferred.reject({message: data, status: status});
+ var requestVnfs = _.map(vnfs, function (vnf) {
+ return {
+ UUID: vnf["modelVersionId"],
+ invariantUUID: vnf["invariant-id"]
+ };
});
-
- return deferred.promise;
+ var requestDetails = {vnfsDetails: requestVnfs};
+ return $http.post(COMPONENT.GET_WORKFLOW, requestDetails)
+ .success(function (response) {
+ return {data: response};
+ })
+ .catch(function (err) {
+ return {data: []};
+ });
};
this.getMSOChangeManagements = function() {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js
index ea46dcb9b..615f25ec2 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/componentService.js
@@ -25,22 +25,26 @@ var ComponentService = function($log, COMPONENT, UtilityService) {
var _this = this;
var componentList = [ {
- id : COMPONENT.NETWORK,
- displayName : "Network"
+ id : COMPONENT.NETWORK,
+ displayName : "Network"
}, {
- id : COMPONENT.SERVICE,
- displayName : "Service Instance"
- }, {id : COMPONENT.OLDVERSION,
- displayName : "Previous Version"
+ id : COMPONENT.SERVICE,
+ displayName : "Service Instance"
+ }, {
+ id : COMPONENT.OLDVERSION,
+ displayName : "Previous Version"
}, {
- id : COMPONENT.VNF,
- displayName : "Virtual Network Function"
+ id : COMPONENT.VNF,
+ displayName : "Virtual Network Function"
+ }, {
+ id : COMPONENT.VF_MODULE,
+ displayName : "VF Module"
}, {
- id : COMPONENT.VF_MODULE,
- displayName : "VF Module"
+ id: COMPONENT.VOLUME_GROUP,
+ displayName: "Volume Group"
}, {
- id : COMPONENT.VOLUME_GROUP,
- displayName : "Volume Group"
+ id : COMPONENT.CONFIGURATION,
+ displayName : "Port Mirroring Configuration"
} ];
var getInventoryInfo = function(suffix, inventoryItem) {
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
index e171e2856..838ab3719 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/creationService.js
@@ -30,345 +30,355 @@
*/
var CreationService = function($log, AaiService, AsdcService, DataService,VIDCONFIGURATION,
- ComponentService, COMPONENT, FIELD, PARAMETER, UtilityService) {
-
- var _this = this;
-
- var getAsyncOperationList = function() {
- if (DataService.getLoggedInUserId() == null)
- getLoggedInUserID();
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- return [ getSubscribers, getServices,getAicZones ];
- case COMPONENT.NETWORK:
- return [ getLcpCloudRegionTenantList ];
- case COMPONENT.VNF:
- return [ getLcpCloudRegionTenantList ];
- case COMPONENT.VF_MODULE:
- return [ getLcpCloudRegionTenantList ];
- case COMPONENT.VOLUME_GROUP:
- return [ getLcpCloudRegionTenantList ];
- }
- };
-
- /*
- * "getSummaryList" and "getUserProvidedList" return parameters that should
- * be displayed in the summary and user provided sections, respectively. The
- * functions are expected to return lists that are in the format needed by
- * the parameter-block directive.
- */
-
- var getSummaryList = function() {
-
- /*
- * These placeholders should be removed and their usage in
- * "getSummaryList" should be replaced by appropriate code as the
- * requirements and interfaces firm up.
- */
-
- var PLACEHOLDER_RESOURCE_DESCRIPTION = "Resource Description (PLACEHOLDER)";
- var PLACEHOLDER_SERVICE_CATEGORY = "Service Category (PLACEHOLDER)";
- var PLACEHOLDER_VF_MODULE_DESCRIPTION = "VF Module Description (PLACEHOLDER)";
- var PLACEHOLDER_VF_MODULE_LABEL = "VF Module Label (PLACEHOLDER)";
- var PLACEHOLDER_VF_MODULE_TYPE = "VF Module Type (PLACEHOLDER)";
-
- _this.parameterList = new Array();
-
- /*
- * Common fields displayed at the top of all create instance screens.
- */
- if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]==null
- || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==undefined
- || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==''){
- addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
- }
-
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- if ( !DataService.getALaCarte() ) {
- // for macro instantiation need to add the resource names under the node template list
- // this field is called modelCustomizationName in the asdc client code
- var p;
- var rlist = DataService.getResources();
- var res;
- if ( rlist != null ) {
- for (var i = 0; i < rlist.length; i++) {
- res = rlist[i];
-
- p = FIELD.NAME.RESOURCE_NAME.concat(" " + (i+1));
- addToList(p, res.name );
- p = FIELD.NAME.RESOURCE_DESCRIPTION.concat(" " + (i+1));
- addToList(p, res.description );
- }
- }
- }
- if(DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=null && DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=''){
- addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
- .getModelInfo(_this.componentId)["createSubscriberName"]);
- }
- if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=null && DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=''){
- addToList(FIELD.NAME.SERVICE_TYPE, DataService
- .getModelInfo(_this.componentId)["serviceTypeName"]);
- addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
- }
- addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.SERVICE_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.SERVICE_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
- addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
- if (DataService.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE] != "null") {
- addToList(FIELD.NAME.SERVICE_TYPE, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE]);
- addToList(FIELD.NAME.SERVICE_ROLE, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_ROLE]);
- }
-
- break;
- case COMPONENT.VF_MODULE:
- addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
- .getSubscriberName());
- addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
- .getServiceInstanceName());
- addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
- addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.MODEL_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.MODEL_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
- break;
- case COMPONENT.VNF:
- addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
- .getSubscriberName());
- addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
- .getServiceInstanceName());
- addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
- addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.MODEL_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.MODEL_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
- addToList(FIELD.NAME.MODEL_CUSTOMIZATION_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_CUSTOMIZATION_NAME]);
- addToList(FIELD.NAME.MODEL_VNF_TYPE, DataService
- .getModelInfo(_this.componentId)[COMPONENT.VNF_TYPE]);
- addToList(FIELD.NAME.MODEL_VNF_ROLE, DataService
- .getModelInfo(_this.componentId)[COMPONENT.VNF_ROLE]);
- addToList(FIELD.NAME.MODEL_VNF_FUNCTION, DataService
- .getModelInfo(_this.componentId)[COMPONENT.VNF_FUNCTION]);
- addToList(FIELD.NAME.MODEL_VNF_CODE, DataService
- .getModelInfo(_this.componentId)[COMPONENT.VNF_CODE]);
- break;
- case COMPONENT.NETWORK:
- case COMPONENT.VOLUME_GROUP:
- addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
- .getSubscriberName());
- addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
- .getServiceInstanceName());
- addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
- addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.MODEL_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.MODEL_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
- break;
- }
-
- return _this.parameterList;
- };
-
- var getUserProvidedList = function() {
- var parameterList = [];
- var isUserProvidedNaming = false;
- if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null)
- && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) {
- isUserProvidedNaming = true;
- }
-
- var isInTop = DataService.getHideServiceFields() || false;
- if (_this.componentId === COMPONENT.SERVICE) {
- if ( DataService.getALaCarte() ) {
- parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
- if(!isInTop){
- parameterList = parameterList.concat([ getSubscribersParameter(),
- FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
- }
- }
- else {
- // macro
-
- if(!isInTop){
- if (isUserProvidedNaming) {
- parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-
- }
- parameterList = parameterList.concat([ getSubscribersParameter() ]);
- parameterList = parameterList.concat([ getServiceId(),
- FIELD.PARAMETER.SERVICE_TYPE,
- FIELD.PARAMETER.LCP_REGION,
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED,
- ]);
- parameterList = parameterList.concat([ getAICZones() ]);
-
-
- }else{
- parameterList = parameterList.concat([ getServiceId(),
- FIELD.PARAMETER.LCP_REGION,
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
- }
- }
- }
- else {
- parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- case COMPONENT.VNF:
- parameterList = parameterList.concat([ getServiceId(),
- getLcpRegion(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
- break;
- case COMPONENT.VF_MODULE:
- parameterList = parameterList.concat([
- getLcpRegion(),
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED
- ]);
-
- var availableVolumeGroupList = DataService.getAvailableVolumeGroupList();
-
- if (availableVolumeGroupList && availableVolumeGroupList.length > 0) {
- var availableVolumeGroupNames = [FIELD.STATUS.NONE];
-
- for (var i = 0; i < availableVolumeGroupList.length; i++) {
- availableVolumeGroupNames.push(availableVolumeGroupList[i].instance.name);
- }
-
- parameterList.push(addOptionList(
- FIELD.PARAMETER.AVAILABLE_VOLUME_GROUP,
- availableVolumeGroupNames));
- }
- break;
- case COMPONENT.VOLUME_GROUP:
- parameterList = parameterList.concat([ getLcpRegion(),
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
- }
- }
- parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
- if(_this.componentId === COMPONENT.VF_MODULE ){
- parameterList.push({name: FIELD.NAME.SDN_C_PRELOAD,
- id: FIELD.ID.SDN_C_PRELOAD,
- type: "checkbox",
- isEnabled: true,
- isRequired: false,
- hideFieldAndLabel: true
- }
- );
- parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- type: "checkbox",
- isEnabled: true,
- isRequired: false,
- value:false
- }
- );
-
- parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
- id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
- type: "file",
- isRequired: false,
- isVisiblity: false
- }
- );
- }
-
- if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED && _this.componentId === COMPONENT.VOLUME_GROUP){
- parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
- type: "checkbox",
- isEnabled: true,
- isRequired: false
- }
- );
-
- parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
- id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
- type: "file",
- isRequired: false,
- isVisiblity: false
- }
- );
- }
-
- addArbitraryParameters(parameterList);
-
- return parameterList;
- };
+ ComponentService, COMPONENT, FIELD, PARAMETER, UtilityService, OwningEntityService) {
+
+ var _this = this;
+
+ var getAsyncOperationList = function() {
+ if (DataService.getLoggedInUserId() == null) {
+ getLoggedInUserID();
+ } else {
+ UtilityService.startNextAsyncOperation();
+ }
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ return [ getSubscribers, getServices, getAicZones, getOwningEntityProperties ];
+ case COMPONENT.NETWORK:
+ return [ getLcpCloudRegionTenantList, getOwningEntityProperties ];
+ case COMPONENT.VNF:
+ return [ getLcpCloudRegionTenantList, getOwningEntityProperties ];
+ case COMPONENT.VF_MODULE:
+ return [ getLcpCloudRegionTenantList ];
+ case COMPONENT.VOLUME_GROUP:
+ return [ getLcpCloudRegionTenantList ];
+ }
+ };
+
+ /*
+ * "getSummaryList" and "getUserProvidedList" return parameters that should
+ * be displayed in the summary and user provided sections, respectively. The
+ * functions are expected to return lists that are in the format needed by
+ * the parameter-block directive.
+ */
+
+ var getSummaryList = function() {
+
+ /*
+ * These placeholders should be removed and their usage in
+ * "getSummaryList" should be replaced by appropriate code as the
+ * requirements and interfaces firm up.
+ */
+
+ var PLACEHOLDER_RESOURCE_DESCRIPTION = "Resource Description (PLACEHOLDER)";
+ var PLACEHOLDER_SERVICE_CATEGORY = "Service Category (PLACEHOLDER)";
+ var PLACEHOLDER_VF_MODULE_DESCRIPTION = "VF Module Description (PLACEHOLDER)";
+ var PLACEHOLDER_VF_MODULE_LABEL = "VF Module Label (PLACEHOLDER)";
+ var PLACEHOLDER_VF_MODULE_TYPE = "VF Module Type (PLACEHOLDER)";
+
+ _this.parameterList = new Array();
+
+ /*
+ * Common fields displayed at the top of all create instance screens.
+ */
+ if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]==null
+ || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==undefined
+ || DataService.getModelInfo(_this.componentId)["serviceTypeName"]==''){
+ addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+ }
+
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ if ( !DataService.getALaCarte() ) {
+ // for macro instantiation need to add the resource names under the node template list
+ // this field is called modelCustomizationName in the asdc client code
+ var p;
+ var rlist = DataService.getResources();
+ var res;
+ if ( rlist != null ) {
+ for (var i = 0; i < rlist.length; i++) {
+ res = rlist[i];
+
+ p = FIELD.NAME.RESOURCE_NAME.concat(" " + (i+1));
+ addToList(p, res.name );
+ p = FIELD.NAME.RESOURCE_DESCRIPTION.concat(" " + (i+1));
+ addToList(p, res.description );
+ }
+ }
+ }
+ if(DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=null && DataService.getModelInfo(_this.componentId)["createSubscriberName"]!=''){
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getModelInfo(_this.componentId)["createSubscriberName"]);
+ }
+ if(DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=null && DataService.getModelInfo(_this.componentId)["serviceTypeName"]!=''){
+ addToList(FIELD.NAME.SERVICE_TYPE, DataService
+ .getModelInfo(_this.componentId)["serviceTypeName"]);
+ addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+ }
+ addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.SERVICE_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.SERVICE_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
+ addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
+ if (DataService.getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE] != "null") {
+ addToList(FIELD.NAME.SERVICE_TYPE, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_TYPE]);
+ addToList(FIELD.NAME.SERVICE_ROLE, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.SERVICE_ROLE]);
+ }
+
+ break;
+ case COMPONENT.VF_MODULE:
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getSubscriberName());
+ addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+ .getServiceInstanceName());
+ addToList(FIELD.NAME.MODEL_NAME, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+ addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.MODEL_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.MODEL_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
+ break;
+ case COMPONENT.VNF:
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getSubscriberName());
+ addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+ .getServiceInstanceName());
+ addToList(FIELD.NAME.MODEL_NAME, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+ addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.MODEL_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.MODEL_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
+ addToList(FIELD.NAME.MODEL_CUSTOMIZATION_NAME, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_CUSTOMIZATION_NAME]);
+ addToList(FIELD.NAME.MODEL_VNF_TYPE, DataService
+ .getModelInfo(_this.componentId)[COMPONENT.VNF_TYPE]);
+ addToList(FIELD.NAME.MODEL_VNF_ROLE, DataService
+ .getModelInfo(_this.componentId)[COMPONENT.VNF_ROLE]);
+ addToList(FIELD.NAME.MODEL_VNF_FUNCTION, DataService
+ .getModelInfo(_this.componentId)[COMPONENT.VNF_FUNCTION]);
+ addToList(FIELD.NAME.MODEL_VNF_CODE, DataService
+ .getModelInfo(_this.componentId)[COMPONENT.VNF_CODE]);
+ break;
+ case COMPONENT.NETWORK:
+ case COMPONENT.VOLUME_GROUP:
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getSubscriberName());
+ addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+ .getServiceInstanceName());
+ addToList(FIELD.NAME.MODEL_NAME, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+ addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.MODEL_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.MODEL_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ addToList(FIELD.NAME.MODEL_CUSTOMIZATION_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.CUSTOMIZATION_UUID]);
+ break;
+ }
+
+ return _this.parameterList;
+ };
+
+ var getUserProvidedList = function() {
+ var parameterList = [];
+ var isUserProvidedNaming = false;
+ if ( (DataService.getModelInfo(_this.componentId).serviceEcompNaming != null)
+ && (DataService.getModelInfo(_this.componentId).serviceEcompNaming === "false") ) {
+ isUserProvidedNaming = true;
+ }
+
+ var isInTop = DataService.getHideServiceFields() || false;
+ if (_this.componentId === COMPONENT.SERVICE) {
+ if ( DataService.getALaCarte() ) {
+ parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+ if(!isInTop){
+ parameterList = parameterList.concat([ getSubscribersParameter(),
+ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+ }
+ }
+ else {
+ // macro
+
+ if(!isInTop){
+ if (isUserProvidedNaming) {
+ parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
- var addArbitraryParameters = function(parameterList) {
- if ( DataService.getModelInfo(_this.componentId).displayInputs != null ) {
- var inputs = DataService.getModelInfo(_this.componentId).displayInputs;
- for ( var key in inputs) {
- var parameter = {
- id : key,
- type : PARAMETER.STRING,
- name : ComponentService.getFieldDisplayName(key),
- value : inputs[key][PARAMETER.DEFAULT],
- isRequired : inputs[key][PARAMETER.REQUIRED],
- description : inputs[key][PARAMETER.DESCRIPTION]
- };
- if ( DataService.getALaCarte() ) {
- parameter.name = ComponentService.getFieldDisplayName(inputs[key][PARAMETER.DISPLAY_NAME]);
- }
- switch (inputs[key][PARAMETER.TYPE]) {
- case PARAMETER.INTEGER:
- parameter.type = PARAMETER.NUMBER;
- break;
- case PARAMETER.BOOLEAN:
- parameter.type = PARAMETER.BOOLEAN;
- break;
- case PARAMETER.RANGE:
- break;
- case PARAMETER.LIST:
- parameter.type = PARAMETER.LIST;
- break;
- case PARAMETER.MAP:
- parameter.type = PARAMETER.MAP;
- break;
- }
-
- if ( UtilityService.hasContents(inputs[key][PARAMETER.CONSTRAINTS])
- && ( inputs[key][PARAMETER.CONSTRAINTS].length > 0 ) ) {
- var constraintsArray = inputs[key][PARAMETER.CONSTRAINTS];
- //console.log ("Calling addConstraintParameters for input name=" + key);
- addConstraintParameters (parameterList, constraintsArray, key, inputs, parameter);
- }
- else {
-
- parameterList.push(parameter);
- }
- }
- DataService.setArbitraryParameters (parameterList);
- }
- };
+ }
+ parameterList = parameterList.concat([ getSubscribersParameter() ]);
+ parameterList = parameterList.concat([ getServiceId(),
+ FIELD.PARAMETER.SERVICE_TYPE,
+ FIELD.PARAMETER.LCP_REGION,
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED
+ ]);
+ parameterList = parameterList.concat([ getAicZonesParameter() ]);
+
+
+ }else{
+ parameterList = parameterList.concat([ getServiceId(),
+ FIELD.PARAMETER.LCP_REGION,
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED ]);
+ }
+ }
+
+ parameterList = parameterList.concat([ getProjectParameter() ]);
+ parameterList = parameterList.concat([ getOwningEntityParameter() ]);
+
+ }
+ else {
+ parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+ switch (_this.componentId) {
+ case COMPONENT.NETWORK:
+ case COMPONENT.VNF:
+ parameterList = parameterList.concat([ getServiceId(),
+ getLcpRegionParameter(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED ]);
+ parameterList = parameterList.concat([ getLineOfBusinessParameter() ]);
+ parameterList = parameterList.concat([ getPlatformParameter() ]);
+
+ break;
+ case COMPONENT.VF_MODULE:
+ parameterList = parameterList.concat([
+ getLcpRegionParameter(),
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED
+ ]);
+
+ var availableVolumeGroupList = DataService.getAvailableVolumeGroupList();
+
+ if (availableVolumeGroupList && availableVolumeGroupList.length > 0) {
+ var availableVolumeGroupNames = [FIELD.STATUS.NONE];
+
+ for (var i = 0; i < availableVolumeGroupList.length; i++) {
+ availableVolumeGroupNames.push(availableVolumeGroupList[i].instance.name);
+ }
+
+ parameterList.push(addOptionList(
+ FIELD.PARAMETER.AVAILABLE_VOLUME_GROUP,
+ availableVolumeGroupNames));
+ }
+ break;
+ case COMPONENT.VOLUME_GROUP:
+ parameterList = parameterList.concat([ getLcpRegionParameter(),
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED ]);
+ }
+ }
+ parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
+ if(_this.componentId === COMPONENT.VF_MODULE ){
+ parameterList.push({name: FIELD.NAME.SDN_C_PRELOAD,
+ id: FIELD.ID.SDN_C_PRELOAD,
+ type: "checkbox",
+ isEnabled: true,
+ isRequired: false,
+ hideFieldAndLabel: true
+ }
+ );
+ parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ type: "checkbox",
+ isEnabled: true,
+ isRequired: false,
+ value:false
+ }
+ );
+
+ parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
+ type: "file",
+ isRequired: false,
+ isVisiblity: false
+ }
+ );
+ }
+
+ if( VIDCONFIGURATION.UPLOAD_SUPPLEMENTARY_STATUS_CHECK_ENABLED && _this.componentId === COMPONENT.VOLUME_GROUP){
+ parameterList.push({name: FIELD.NAME.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE,
+ type: "checkbox",
+ isEnabled: true,
+ isRequired: false
+ }
+ );
+
+ parameterList.push({name: FIELD.NAME.SUPPLEMENTORY_DATA_FILE,
+ id: FIELD.ID.SUPPLEMENTORY_DATA_FILE,
+ type: "file",
+ isRequired: false,
+ isVisiblity: false
+ }
+ );
+ }
+
+ addArbitraryParameters(parameterList);
+
+ return parameterList;
+ };
+
+ var addArbitraryParameters = function(parameterList) {
+ if ( DataService.getModelInfo(_this.componentId).displayInputs != null ) {
+ var inputs = DataService.getModelInfo(_this.componentId).displayInputs;
+ for ( var key in inputs) {
+ var parameter = {
+ id : key,
+ type : PARAMETER.STRING,
+ name : ComponentService.getFieldDisplayName(key),
+ value : inputs[key][PARAMETER.DEFAULT],
+ isRequired : inputs[key][PARAMETER.REQUIRED],
+ description : inputs[key][PARAMETER.DESCRIPTION]
+ };
+ if ( DataService.getALaCarte() ) {
+ parameter.name = ComponentService.getFieldDisplayName(inputs[key][PARAMETER.DISPLAY_NAME]);
+ }
+ switch (inputs[key][PARAMETER.TYPE]) {
+ case PARAMETER.INTEGER:
+ parameter.type = PARAMETER.NUMBER;
+ break;
+ case PARAMETER.BOOLEAN:
+ parameter.type = PARAMETER.BOOLEAN;
+ break;
+ case PARAMETER.RANGE:
+ break;
+ case PARAMETER.LIST:
+ parameter.type = PARAMETER.LIST;
+ break;
+ case PARAMETER.MAP:
+ parameter.type = PARAMETER.MAP;
+ break;
+ }
+
+ if ( UtilityService.hasContents(inputs[key][PARAMETER.CONSTRAINTS])
+ && ( inputs[key][PARAMETER.CONSTRAINTS].length > 0 ) ) {
+ var constraintsArray = inputs[key][PARAMETER.CONSTRAINTS];
+ //console.log ("Calling addConstraintParameters for input name=" + key);
+ addConstraintParameters (parameterList, constraintsArray, key, inputs, parameter);
+ }
+ else {
+
+ parameterList.push(parameter);
+ }
+ }
+ DataService.setArbitraryParameters (parameterList);
+ }
+ };
var addConstraintParameters = function(parameterList, constraintsArray, key, inputs, parameter) {
// If there are constraints and the operator is "valid_values",
@@ -485,614 +495,697 @@ var CreationService = function($log, AaiService, AsdcService, DataService,VIDCON
value : value
});
};
-
- /*
- * The "*Mso*" functions return URL and request details that can be passed
- * to the MSO controller. The request details defines the info passed as
- * part of the POST body.
- */
-
- var getMsoUrl = function() {
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- return "mso_create_nw_instance/"
- + DataService.getServiceInstanceId();
- case COMPONENT.SERVICE:
- return "mso_create_svc_instance";
- case COMPONENT.VNF:
- return "mso_create_vnf_instance/"
- + DataService.getServiceInstanceId();
- case COMPONENT.VF_MODULE:
- return "mso_create_vfmodule_instance/"
- + DataService.getServiceInstanceId() + "/vnfs/"
- + DataService.getVnfInstanceId();
- case COMPONENT.VOLUME_GROUP:
- return "mso_create_volumegroup_instance/"
- + DataService.getServiceInstanceId() + "/vnfs/"
- + DataService.getVnfInstanceId();
- }
- };
-
- var getMsoRequestDetails = function(parameterList) {
- console.log("getMsoRequestDetails invoked, parameterList="); console.log(JSON.stringify(parameterList,null,4));
- //console.log("getMsoRequestDetails invoked, DataService.getArbitraryParameters()=");
- //console.log(JSON.stringify(DataService.getArbitraryParameters(),null,4));
-
- var modelInfo = DataService.getModelInfo(_this.componentId);
- var requestorloggedInId = DataService.getLoggedInUserId();
- if (requestorloggedInId == null)
- requestorloggedInId = "";
- var isSupRollback = false;
- if (getValueFromList(FIELD.ID.SUPPRESS_ROLLBACK,parameterList) === "true") {
- isSupRollback = true;
- }
- var requestDetails = {
- requestInfo : {
- instanceName : getValueFromList(FIELD.ID.INSTANCE_NAME,
- parameterList),
- source : FIELD.ID.VID,
- suppressRollback : isSupRollback,
- requestorId: requestorloggedInId
- },
- modelInfo : {
- modelType : _this.componentId,
- modelInvariantId : modelInfo.modelInvariantId,
- modelVersionId : modelInfo.modelNameVersionId,
- modelName : modelInfo.modelName,
- modelVersion : modelInfo.modelVersion,
- modelCustomizationId: modelInfo.customizationUuid,
- modelCustomizationName : modelInfo.modelCustomizationName
- },
- requestParameters : {
- userParams : getArbitraryParameters(parameterList)
- }
- };
- if ( (_this.componentId != COMPONENT.SERVICE) || ( !DataService.getALaCarte() ) ) {
- // include cloud region for everything but service create alacarte
- var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
- lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
- parameterList);
- }
- requestDetails.cloudConfiguration = {
- lcpCloudRegionId : lcpRegion,
- tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
- };
- }
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- requestDetails.subscriberInfo = {
- globalSubscriberId : DataService.getGlobalCustomerId(),
- subscriberName : DataService.getSubscriberName()
- };
- var isInTop = DataService.getHideServiceFields() || false;
- if(isInTop){
- requestDetails.requestParameters.subscriptionServiceType = DataService.getModelInfo(_this.componentId)["serviceTypeName"];
- }else{
- requestDetails.requestParameters.subscriptionServiceType = getValueFromList(
- FIELD.ID.SERVICE_TYPE, parameterList);
- }
- requestDetails.requestParameters.aLaCarte = DataService.getALaCarte();
- if ( !DataService.getALaCarte() ) {
- requestDetails.requestInfo.productFamilyId = getValueFromList(
- FIELD.ID.PRODUCT_FAMILY, parameterList);
- }
- var svcModelInfo = {
- modelType : _this.componentId,
- modelInvariantId : modelInfo.modelInvariantId,
- modelVersionId : modelInfo.modelNameVersionId,
- modelName : modelInfo.modelName,
- modelVersion : modelInfo.modelVersion
- };
- requestDetails.modelInfo = svcModelInfo;
- break;
- case COMPONENT.VNF:
-
- requestDetails.requestInfo.productFamilyId = getValueFromList(
- FIELD.ID.PRODUCT_FAMILY, parameterList);
- break;
- case COMPONENT.NETWORK:
- requestDetails.requestInfo.productFamilyId = getValueFromList(
- FIELD.ID.PRODUCT_FAMILY, parameterList);
-
- break;
- case COMPONENT.VF_MODULE:
- requestDetails.requestParameters.usePreload = getValueFromList(
- FIELD.ID.SDN_C_PRELOAD, parameterList);
- if(_this.componentId == COMPONENT.VF_MODULE &&(requestDetails.requestParameters.usePreload== null || requestDetails.requestParameters.usePreload === '')){
- requestDetails.requestParameters.usePreload = false;
- }
- break;
- case COMPONENT.VOLUME_GROUP:
- break;
- }
-
- var relatedInstanceList = getRelatedInstanceList(parameterList);
-
- if (relatedInstanceList !== undefined) {
- requestDetails.relatedInstanceList = relatedInstanceList;
- }
-
- return requestDetails;
- };
-
- var getRelatedInstanceList = function(parameterList) {
- var relatedInstanceList = new Array();
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- return undefined;
- case COMPONENT.NETWORK:
- case COMPONENT.VNF:
- addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
- DataService.getServiceInstanceId());
- break;
- case COMPONENT.VF_MODULE:
- addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
- DataService.getServiceInstanceId());
- addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
- .getVnfInstanceId());
-
- var availableVolumeGroup = getValueFromList(
- FIELD.ID.AVAILABLE_VOLUME_GROUP, parameterList);
-
- if (UtilityService.hasContents(availableVolumeGroup) && availableVolumeGroup !== "None") {
- var availableVolumeGroups = DataService.getAvailableVolumeGroupList();
-
- for (var i = 0; i < availableVolumeGroups.length; i++) {
- if (availableVolumeGroups[i].instance.name == availableVolumeGroup) {
- DataService.setModelInfo(COMPONENT.VOLUME_GROUP, DataService.getModelInfo(COMPONENT.VF_MODULE));
- DataService.setVolumeGroupInstanceId(availableVolumeGroups[i].instance.object["volume-group-id"]);
- break;
- }
- }
-
- addRelatedInstance(relatedInstanceList, COMPONENT.VOLUME_GROUP,
- DataService.getVolumeGroupInstanceId());
- }
- break;
- case COMPONENT.VOLUME_GROUP:
- addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
- DataService.getServiceInstanceId());
- addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
- .getVnfInstanceId());
- break;
- }
-
- return relatedInstanceList;
- };
-
- var addRelatedInstance = function(relatedInstanceList, componentId,
- instanceId) {
- var modelInfo = DataService.getModelInfo(componentId);
- var relatedInstance;
- if (modelInfo !== undefined) {
- if (componentId === COMPONENT.SERVICE) {
- relatedInstance = {
- "instanceId" : instanceId,
- "modelInfo" : {
- "modelType" : componentId,
- "modelName" : modelInfo.modelName,
- "modelInvariantId" : modelInfo.modelInvariantId,
- "modelVersion" : modelInfo.modelVersion,
- "modelVersionId" : modelInfo.modelNameVersionId,
-
- }
- };
- }
- else {
- relatedInstance = {
- "instanceId" : instanceId,
- "modelInfo" : {
- "modelType" : componentId,
- "modelName" : modelInfo.modelName,
- "modelInvariantId" : modelInfo.modelInvariantId,
- "modelVersion" : modelInfo.modelVersion,
- "modelVersionId" : modelInfo.modelNameVersionId,
- "modelCustomizationId": modelInfo.customizationUuid,
- "modelCustomizationName": modelInfo.modelCustomizationName
- }
- }
- }
- relatedInstanceList.push({
- relatedInstance : relatedInstance
- });
- }
- };
-
- /*
- * var getArbitraryParameters = function(parameterList) { var
- * arbitraryParameters = new Object(); for (var i = 0; i <
- * parameterList.length; i++) { var parameter = parameterList[i]; switch
- * (parameter.id) { case FIELD.ID.INSTANCE_NAME: case
- * FIELD.ID.PRODUCT_FAMILY: case FIELD.ID.LCP_REGION: case
- * FIELD.ID.LCP_REGION_TEXT: case FIELD.ID.SERVICE_TYPE: case
- * FIELD.ID.TENANT: case FIELD.ID.SUPPRESS_ROLLBACK: break; default:
- * arbitraryParameters[parameter.id] = parameter.value; } } return
- * arbitraryParameters; }
- */
- var getArbitraryParameters = function(parameterList) {
- var arbitraryParameters = new Object();
- var arbitraryArray = new Array();
- for (var i = 0; i < parameterList.length; i++) {
- var parameter = parameterList[i];
- switch (parameter.id) {
- case FIELD.ID.AVAILABLE_VOLUME_GROUP:
- break;
- case FIELD.ID.INSTANCE_NAME:
- break;
- case FIELD.ID.PRODUCT_FAMILY:
- break;
- case FIELD.ID.LCP_REGION:
- break;
- case FIELD.ID.LCP_REGION_TEXT:
- break;
- case FIELD.ID.SERVICE_TYPE:
- break;
- case FIELD.ID.TENANT:
- break;
- case FIELD.ID.SUPPRESS_ROLLBACK:
- break;
- case FIELD.ID.SUBSCRIBER_NAME:
- break;
- case FIELD.ID.SDN_C_PRELOAD:
- break;
- case FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE:
- break;
- case FIELD.ID.SUPPLEMENTORY_DATA_FILE:
- arbitraryParameters = FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'];
- arbitraryArray=arbitraryParameters;
- FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=[];
- break;
-
- default:
- if (parameter.value != '') {
- arbitraryParameters = {
- name: parameter.id,
- value: parameter.value
- }
- arbitraryArray.push(arbitraryParameters);
- }
- }
- }
- return (arbitraryArray);
+ var setInventoryInfo = function(){
+ var inventoryItem = DataService.getInventoryItem();
+ var inventoryInfo = ComponentService.getInventoryInfo(
+ _this.componentId, inventoryItem);
}
- var getModel = function() {
- AsdcService.getModel(DataService.getModelId(), function(response) {
- DataService.setModelInfo(_this.componentId, {
- modelInvariantId : response.data.invariantUUID,
- modelNameVersionId : response.data.uuid,
- modelName : response.data.name,
- modelVersion : response.data.version,
- inputs : response.data.inputs
- });
- UtilityService.startNextAsyncOperation();
- });
- };
-
- var getSubscriptionServiceTypeList = function() {
- AaiService.getSubscriptionServiceTypeList(DataService
- .getGlobalCustomerId(), function(response) {
- DataService.setSubscriptionServiceTypeList(response);
- UtilityService.startNextAsyncOperation();
- });
- };
-
- var getLoggedInUserID = function() {
- AaiService.getLoggedInUserID(function(response) {
- DataService.setLoggedInUserId(response.data);
- UtilityService.startNextAsyncOperation();
- });
- };
-
- var getSubscribers = function() {
- AaiService.getSubscribers(function(response) {
- DataService.setSubscribers(response);
- UtilityService.startNextAsyncOperation();
- });
- };
- var getServices = function() {
- AaiService.getServices(function(response) {
- var serviceIdList = [];
- angular.forEach(response.data, function(value, key) {
- angular.forEach(value, function(subVal, key) {
- var newVal = {
- "id" : subVal[FIELD.ID.SERVICE_ID],
- "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION],
- "isPermitted" : subVal[FIELD.ID.IS_PERMITTED],
- };
- serviceIdList.push(newVal);
- DataService.setServiceIdList(serviceIdList);
- });
- });
-
- UtilityService.startNextAsyncOperation();
- });
- };
- var getAicZones = function() {
- AaiService.getAicZones(function(response) {
- var serviceIdList = [];
- angular.forEach(response.data, function(value, key) {
- angular.forEach(value, function(subVal, key) {
- var newVal = {
- "id" : subVal[FIELD.ID.ZONE_ID],
- "name" : subVal[FIELD.ID.ZONE_NAME],
- };
- serviceIdList.push(newVal);
- DataService.setAicZones(serviceIdList);
- });
- });
-
- UtilityService.startNextAsyncOperation();
- });
-
- };
-
-
-
- var getLcpCloudRegionTenantList = function() {
- AaiService.getLcpCloudRegionTenantList(DataService
- .getGlobalCustomerId(), DataService.getServiceType(), function(
- response) {
- DataService.setCloudRegionTenantList(response);
- UtilityService.startNextAsyncOperation();
- });
- };
+ /*
+ * The "*Mso*" functions return URL and request details that can be passed
+ * to the MSO controller. The request details defines the info passed as
+ * part of the POST body.
+ */
+
+ var getMsoUrl = function() {
+ switch (_this.componentId) {
+ case COMPONENT.NETWORK:
+ return "mso_create_nw_instance/"
+ + DataService.getServiceInstanceId();
+ case COMPONENT.SERVICE:
+ return "mso_create_svc_instance";
+ case COMPONENT.VNF:
+ return "mso_create_vnf_instance/"
+ + DataService.getServiceInstanceId();
+ case COMPONENT.VF_MODULE:
+ return "mso_create_vfmodule_instance/"
+ + DataService.getServiceInstanceId() + "/vnfs/"
+ + DataService.getVnfInstanceId();
+ case COMPONENT.VOLUME_GROUP:
+ return "mso_create_volumegroup_instance/"
+ + DataService.getServiceInstanceId() + "/vnfs/"
+ + DataService.getVnfInstanceId();
+ }
+ };
+
+ var getMsoRequestDetails = function(parameterList) {
+ console.log("getMsoRequestDetails invoked, parameterList="); console.log(JSON.stringify(parameterList,null,4));
+ //console.log("getMsoRequestDetails invoked, DataService.getArbitraryParameters()=");
+ //console.log(JSON.stringify(DataService.getArbitraryParameters(),null,4));
+
+ var modelInfo = DataService.getModelInfo(_this.componentId);
+ var requestorloggedInId = DataService.getLoggedInUserId();
+ var owningEntityId = getValueFromList(FIELD.ID.OWNING_ENTITY, parameterList);
+ if (requestorloggedInId == null)
+ requestorloggedInId = "";
+ var isSupRollback = false;
+ if (getValueFromList(FIELD.ID.SUPPRESS_ROLLBACK,parameterList) === "true") {
+ isSupRollback = true;
+ }
+ var requestDetails = {
+ requestInfo : {
+ instanceName : getValueFromList(FIELD.ID.INSTANCE_NAME,
+ parameterList) || DataService.getVfModuleInstanceName(),
+ source : FIELD.ID.VID,
+ suppressRollback : isSupRollback,
+ requestorId: requestorloggedInId
+ },
+ modelInfo : {
+ modelType : _this.componentId,
+ modelInvariantId : modelInfo.modelInvariantId,
+ modelVersionId : modelInfo.modelNameVersionId,
+ modelName : modelInfo.modelName,
+ modelVersion : modelInfo.modelVersion,
+ modelCustomizationId: modelInfo.customizationUuid,
+ modelCustomizationName : modelInfo.modelCustomizationName
+ },
+ requestParameters : {
+ userParams : getArbitraryParameters(parameterList)
+ }
+ };
+ if ( (_this.componentId != COMPONENT.SERVICE) || ( !DataService.getALaCarte() ) ) {
+ // include cloud region for everything but service create alacarte
+ var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+ if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+ lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+ parameterList);
+ }
+ requestDetails.cloudConfiguration = {
+ lcpCloudRegionId : lcpRegion,
+ tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+ };
+ }
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ requestDetails.subscriberInfo = {
+ globalSubscriberId : DataService.getGlobalCustomerId(),
+ subscriberName : DataService.getSubscriberName()
+ };
+ var isInTop = DataService.getHideServiceFields() || false;
+ if(isInTop){
+ requestDetails.requestParameters.subscriptionServiceType = DataService.getModelInfo(_this.componentId)["serviceTypeName"];
+ }else{
+ requestDetails.requestParameters.subscriptionServiceType = getValueFromList(
+ FIELD.ID.SERVICE_TYPE, parameterList);
+ }
+ requestDetails.requestParameters.aLaCarte = DataService.getALaCarte();
+ if ( !DataService.getALaCarte() ) {
+ requestDetails.requestInfo.productFamilyId = getValueFromList(
+ FIELD.ID.PRODUCT_FAMILY, parameterList);
+ }
+ var svcModelInfo = {
+ modelType : _this.componentId,
+ modelInvariantId : modelInfo.modelInvariantId,
+ modelVersionId : modelInfo.modelNameVersionId,
+ modelName : modelInfo.modelName,
+ modelVersion : modelInfo.modelVersion
+ };
+ requestDetails.modelInfo = svcModelInfo;
+
+ var selectedProject = getValueFromList(FIELD.ID.PROJECT, parameterList);
+
+ if (selectedProject) {
+ requestDetails.project = {
+ projectName: getValueFromList(FIELD.ID.PROJECT, parameterList)
+ };
+ }
+
+ requestDetails.owningEntity = {
+ owningEntityId: owningEntityId,
+ owningEntityName: getOwningEntityNameById(owningEntityId)
+ };
+
+ break;
+ case COMPONENT.VNF:
+
+ requestDetails.requestInfo.productFamilyId = getValueFromList(
+ FIELD.ID.PRODUCT_FAMILY, parameterList);
+
+ var lineOfBusiness = getValueFromList(FIELD.ID.LINE_OF_BUSINESS, parameterList);
+
+ if(lineOfBusiness) {
+ var lineOfBusinessNamesString = _.map(lineOfBusiness, "name").join(", ");
+
+ requestDetails.lineOfBusiness = {
+ lineOfBusinessName: lineOfBusinessNamesString
+ }
+ }
- var internalGetParametersHandler = function() {
- if (angular.isFunction(_this.getParametersHandler)) {
- _this.getParametersHandler({
- summaryList : getSummaryList(),
- userProvidedList : getUserProvidedList()
- });
- }
- };
+ requestDetails.platform = {
+ platformName: getValueFromList(FIELD.ID.PLATFORM, parameterList)
+ };
- var getSubscribersParameter = function() {
- var subscribers = DataService.getSubscribers();
- var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
- if ( UtilityService.hasContents(subscribers)) {
- parameter.optionList = [];
-
- for (var i = 0; i < subscribers.length; i++) {
- parameter.optionList.push({
- id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
- name : subscribers[i][FIELD.ID.SUBNAME],
- isPermitted : subscribers[i][FIELD.ID.IS_PERMITTED]
- })
- }
- }
- return parameter;
- };
+ break;
+ case COMPONENT.NETWORK:
+ requestDetails.requestInfo.productFamilyId = getValueFromList(
+ FIELD.ID.PRODUCT_FAMILY, parameterList);
+ var lineOfBusiness = getValueFromList(FIELD.ID.LINE_OF_BUSINESS, parameterList);
- var getServiceId = function() {
- var serviceIdList = DataService.getServiceIdList();
- //var serviceTypeList = DataService.getSubscriptionServiceTypeList();
- var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
- parameter.optionList = new Array();
- if ( UtilityService.hasContents(serviceIdList) ) {
- // load them all
- for (var i = 0; i < serviceIdList.length; i++) {
- parameter.optionList.push({
- id : serviceIdList[i].id,
- name : serviceIdList[i].description,
- isPermitted : serviceIdList[i].isPermitted
- });
- }
- }
-
- return parameter;
- };
-
- var getAICZones = function() {
- var aicList = DataService.getAicZones();
- var parameter = FIELD.PARAMETER.AIC_ZONES;
- parameter.optionList = new Array();
- if ( UtilityService.hasContents(aicList) ) {
- // load them all
- for (var i = 0; i < aicList.length; i++) {
- parameter.optionList.push({
- id : aicList[i].id,
- name : aicList[i].name,
- isPermitted : true
-
- });
- }
- }
-
- return parameter;
- };
+ if(lineOfBusiness) {
+ var lineOfBusinessNamesString = _.map(lineOfBusiness, "name").join(", ");
+ requestDetails.lineOfBusiness = {
+ lineOfBusinessName: lineOfBusinessNamesString
+ }
+ }
+
+ requestDetails.platform = {
+ platformName: getValueFromList(FIELD.ID.PLATFORM, parameterList)
+ };
+ break;
+ case COMPONENT.VF_MODULE:
+ requestDetails.requestParameters.usePreload = getValueFromList(
+ FIELD.ID.SDN_C_PRELOAD, parameterList);
+ if(_this.componentId == COMPONENT.VF_MODULE &&(requestDetails.requestParameters.usePreload== null || requestDetails.requestParameters.usePreload === '')){
+ requestDetails.requestParameters.usePreload = false;
+ }
+ break;
+ case COMPONENT.VOLUME_GROUP:
+ break;
+ }
+
+ var relatedInstanceList = getRelatedInstanceList(parameterList);
+
+ if (relatedInstanceList !== undefined) {
+ requestDetails.relatedInstanceList = relatedInstanceList;
+ }
+
+ return requestDetails;
+ };
+
+ var getRelatedInstanceList = function(parameterList) {
+ var relatedInstanceList = new Array();
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ return undefined;
+ case COMPONENT.NETWORK:
+ case COMPONENT.VNF:
+ addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
+ DataService.getServiceInstanceId());
+ break;
+ case COMPONENT.VF_MODULE:
+ addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
+ DataService.getServiceInstanceId());
+ addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
+ .getVnfInstanceId());
+
+ var availableVolumeGroup = getValueFromList(
+ FIELD.ID.AVAILABLE_VOLUME_GROUP, parameterList);
+
+ if (UtilityService.hasContents(availableVolumeGroup) && availableVolumeGroup !== "None") {
+ var availableVolumeGroups = DataService.getAvailableVolumeGroupList();
+
+ for (var i = 0; i < availableVolumeGroups.length; i++) {
+ if (availableVolumeGroups[i].instance.name == availableVolumeGroup) {
+ DataService.setModelInfo(COMPONENT.VOLUME_GROUP, DataService.getModelInfo(COMPONENT.VF_MODULE));
+ DataService.setVolumeGroupInstanceId(availableVolumeGroups[i].instance.object["volume-group-id"]);
+ break;
+ }
+ }
- var getLcpRegion = function() {
- var cloudRegionTenantList = DataService.getCloudRegionTenantList();
- console.log ( "cloudRegionTenantList=");
- console.log ( JSON.stringify (cloudRegionTenantList, null, 4 ));
+ addRelatedInstance(relatedInstanceList, COMPONENT.VOLUME_GROUP,
+ DataService.getVolumeGroupInstanceId());
+ }
+ break;
+ case COMPONENT.VOLUME_GROUP:
+ addRelatedInstance(relatedInstanceList, COMPONENT.SERVICE,
+ DataService.getServiceInstanceId());
+ addRelatedInstance(relatedInstanceList, COMPONENT.VNF, DataService
+ .getVnfInstanceId());
+ break;
+ }
+
+ return relatedInstanceList;
+ };
+
+ var addRelatedInstance = function(relatedInstanceList, componentId,
+ instanceId) {
+ var modelInfo = DataService.getModelInfo(componentId);
+ var relatedInstance;
+ if (modelInfo !== undefined) {
+ if (componentId === COMPONENT.SERVICE) {
+ relatedInstance = {
+ "instanceId" : instanceId,
+ "modelInfo" : {
+ "modelType" : componentId,
+ "modelName" : modelInfo.modelName,
+ "modelInvariantId" : modelInfo.modelInvariantId,
+ "modelVersion" : modelInfo.modelVersion,
+ "modelVersionId" : modelInfo.modelNameVersionId,
- var parameter = FIELD.PARAMETER.LCP_REGION;
- if ( UtilityService.hasContents (cloudRegionTenantList) ) {
- parameter.optionList = new Array();
- for (var i = 0; i < cloudRegionTenantList.length; i++) {
- for (var j = 0; j < parameter.optionList.length; j++) {
- if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
+ }
+ };
+ }
+ else {
+ relatedInstance = {
+ "instanceId" : instanceId,
+ "modelInfo" : {
+ "modelType" : componentId,
+ "modelName" : modelInfo.modelName,
+ "modelInvariantId" : modelInfo.modelInvariantId,
+ "modelVersion" : modelInfo.modelVersion,
+ "modelVersionId" : modelInfo.modelNameVersionId,
+ "modelCustomizationId": modelInfo.customizationUuid,
+ "modelCustomizationName": modelInfo.modelCustomizationName
+ }
+ }
+ }
+ relatedInstanceList.push({
+ relatedInstance : relatedInstance
+ });
+ }
+ };
+
+ /*
+ * var getArbitraryParameters = function(parameterList) { var
+ * arbitraryParameters = new Object(); for (var i = 0; i <
+ * parameterList.length; i++) { var parameter = parameterList[i]; switch
+ * (parameter.id) { case FIELD.ID.INSTANCE_NAME: case
+ * FIELD.ID.PRODUCT_FAMILY: case FIELD.ID.LCP_REGION: case
+ * FIELD.ID.LCP_REGION_TEXT: case FIELD.ID.SERVICE_TYPE: case
+ * FIELD.ID.TENANT: case FIELD.ID.SUPPRESS_ROLLBACK: break; default:
+ * arbitraryParameters[parameter.id] = parameter.value; } } return
+ * arbitraryParameters; }
+ */
+ var getArbitraryParameters = function(parameterList) {
+ var arbitraryParameters = new Object();
+ var arbitraryArray = new Array();
+ for (var i = 0; i < parameterList.length; i++) {
+ var parameter = parameterList[i];
+ switch (parameter.id) {
+ case FIELD.ID.AVAILABLE_VOLUME_GROUP:
+ case FIELD.ID.INSTANCE_NAME:
+ case FIELD.ID.PRODUCT_FAMILY:
+ case FIELD.ID.LCP_REGION:
+ case FIELD.ID.LCP_REGION_TEXT:
+ case FIELD.ID.SERVICE_TYPE:
+ case FIELD.ID.TENANT:
+ case FIELD.ID.SUPPRESS_ROLLBACK:
+ case FIELD.ID.SUBSCRIBER_NAME:
+ case FIELD.ID.SDN_C_PRELOAD:
+ case FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE:
+ case FIELD.ID.OWNING_ENTITY:
+ case FIELD.ID.PLATFORM:
+ case FIELD.ID.LINE_OF_BUSINESS:
+ case FIELD.ID.PROJECT:
+ break;
+ case FIELD.ID.SUPPLEMENTORY_DATA_FILE:
+ arbitraryParameters = FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value'];
+ arbitraryArray=arbitraryParameters;
+ FIELD.PARAMETER.SUPPLEMENTORY_DATA_FILE['value']=[];
+ break;
+
+ default:
+ if (parameter.value != '') {
+ arbitraryParameters = {
+ name: parameter.id,
+ value: parameter.value
+ }
+ arbitraryArray.push(arbitraryParameters);
+ }
+ }
+ }
+ return (arbitraryArray);
+ }
+
+ var getModel = function() {
+ AsdcService.getModel(DataService.getModelId(), function(response) {
+ DataService.setModelInfo(_this.componentId, {
+ modelInvariantId : response.data.invariantUUID,
+ modelNameVersionId : response.data.uuid,
+ modelName : response.data.name,
+ modelVersion : response.data.version,
+ inputs : response.data.inputs
+ });
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var getSubscriptionServiceTypeList = function() {
+ AaiService.getSubscriptionServiceTypeList(DataService
+ .getGlobalCustomerId(), function(response) {
+ DataService.setSubscriptionServiceTypeList(response);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var getLoggedInUserID = function() {
+ AaiService.getLoggedInUserID(function(response) {
+ DataService.setLoggedInUserId(response.data);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var getSubscribers = function() {
+ AaiService.getSubscribers(function(response) {
+ DataService.setSubscribers(response);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+ var getServices = function() {
+ AaiService.getServices(function(response) {
+ var serviceIdList = [];
+ angular.forEach(response.data, function(value, key) {
+ angular.forEach(value, function(subVal, key) {
+ var newVal = {
+ "id" : subVal[FIELD.ID.SERVICE_ID],
+ "description" : subVal[FIELD.ID.SERVICE_DESCRIPTION],
+ "isPermitted" : subVal[FIELD.ID.IS_PERMITTED],
+ };
+ serviceIdList.push(newVal);
+ DataService.setServiceIdList(serviceIdList);
+ });
+ });
+
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+ var getAicZones = function() {
+ AaiService.getAicZones(function(response) {
+ var serviceIdList = [];
+ angular.forEach(response.data, function(value, key) {
+ angular.forEach(value, function(subVal, key) {
+ var newVal = {
+ "id" : subVal[FIELD.ID.ZONE_ID],
+ "name" : subVal[FIELD.ID.ZONE_NAME],
+ };
+ serviceIdList.push(newVal);
+ DataService.setAicZones(serviceIdList);
+ });
+ });
+
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var getOwningEntityProperties = function() {
+ OwningEntityService.getOwningEntityProperties(function(owningEntityProperties) {
+ DataService.setOwningEntityProperties(owningEntityProperties);
+ UtilityService.startNextAsyncOperation();
+ });
+
+ };
+
+ var getLcpCloudRegionTenantList = function() {
+ AaiService.getLcpCloudRegionTenantList(DataService
+ .getGlobalCustomerId(), DataService.getServiceType(), function(
+ response) {
+ DataService.setCloudRegionTenantList(response);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var internalGetParametersHandler = function() {
+ if (angular.isFunction(_this.getParametersHandler)) {
+ _this.getParametersHandler({
+ summaryList : getSummaryList(),
+ userProvidedList : getUserProvidedList()
+ });
+ }
+ };
+
+ var getSubscribersParameter = function() {
+ var subscribers = DataService.getSubscribers();
+ var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
+ if ( UtilityService.hasContents(subscribers)) {
+ parameter.optionList = [];
+
+ for (var i = 0; i < subscribers.length; i++) {
+ parameter.optionList.push({
+ id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
+ name : subscribers[i][FIELD.ID.SUBNAME],
+ isPermitted : subscribers[i][FIELD.ID.IS_PERMITTED]
+ })
+ }
+ }
+ return parameter;
+ };
+
+ var getServiceId = function() {
+ var serviceIdList = DataService.getServiceIdList();
+ //var serviceTypeList = DataService.getSubscriptionServiceTypeList();
+ var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
+ parameter.optionList = new Array();
+ if ( UtilityService.hasContents(serviceIdList) ) {
+ // load them all
+ for (var i = 0; i < serviceIdList.length; i++) {
+ parameter.optionList.push({
+ id : serviceIdList[i].id,
+ name : serviceIdList[i].description,
+ isPermitted : serviceIdList[i].isPermitted
+ });
+ }
+ }
+
+ return parameter;
+ };
+
+ var getAicZonesParameter = function() {
+ var aicList = DataService.getAicZones();
+ var parameter = FIELD.PARAMETER.AIC_ZONES;
+ parameter.optionList = new Array();
+ if ( UtilityService.hasContents(aicList) ) {
+ // load them all
+ for (var i = 0; i < aicList.length; i++) {
+ parameter.optionList.push({
+ id : aicList[i].id,
+ name : aicList[i].name,
+ isPermitted : true
+
+ });
+ }
+ }
+
+ return parameter;
+ };
+
+ var getProjectParameter = function() {
+ return getOwningEntityParameterWithOptions(FIELD.PARAMETER.PROJECT);
+ };
+
+ var getOwningEntityParameter = function() {
+ return getOwningEntityParameterWithOptions(FIELD.PARAMETER.OWNING_ENTITY);
+ };
+
+ var getLineOfBusinessParameter = function() {
+ return getOwningEntityParameterWithOptions(FIELD.PARAMETER.LINE_OF_BUSINESS);
+ };
+
+ var getPlatformParameter = function() {
+ return getOwningEntityParameterWithOptions(FIELD.PARAMETER.PLATFORM);
+ };
+
+ var getOwningEntityNameById = function (id) {
+ var properties = DataService.getOwningEntityProperties();
+ var parameter = _.find(properties[FIELD.ID.OWNING_ENTITY], {"id": id});
+ return parameter && parameter.name;
+ };
+
+ var getOwningEntityParameterWithOptions = function(parameter) {
+ var properties = DataService.getOwningEntityProperties();
+ if (properties && properties[parameter.id]) {
+ parameter.optionList = _.map(properties[parameter.id], function(parameter) {
+ return {
+ "id" : parameter.id,
+ "name" : parameter.name,
+ "isPermitted": true
+ };
+ });
+ }
+
+ return parameter;
+ };
+
+ var getLcpRegionParameter = function() {
+ var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+ console.log ( "cloudRegionTenantList=");
+ console.log ( JSON.stringify (cloudRegionTenantList, null, 4 ));
+
+ var parameter = FIELD.PARAMETER.LCP_REGION;
+ if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+ parameter.optionList = new Array();
+ for (var i = 0; i < cloudRegionTenantList.length; i++) {
+ for (var j = 0; j < parameter.optionList.length; j++) {
+ if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
parameter.optionList[j].isPermitted =
- parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+ parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
break;
}
- }
- if (j < parameter.optionList.length) {
- continue;
- }
- parameter.optionList.push({
- id : cloudRegionTenantList[i].cloudRegionId,
- isPermitted : cloudRegionTenantList[i].isPermitted
- });
- }
- }
- return parameter;
- };
-
- var getTenantList = function(cloudRegionId) {
- var cloudRegionTenantList = DataService.getCloudRegionTenantList();
- var parameter = "";
- if ( UtilityService.hasContents (cloudRegionTenantList) ) {
- parameter = FIELD.PARAMETER.TENANT_ENABLED;
- parameter.optionList = new Array();
- for (var i = 0; i < cloudRegionTenantList.length; i++) {
- if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
- parameter.optionList.push({
- id : cloudRegionTenantList[i].tenantId,
- name : cloudRegionTenantList[i].tenantName,
+ }
+ if (j < parameter.optionList.length) {
+ continue;
+ }
+ parameter.optionList.push({
+ id : cloudRegionTenantList[i].cloudRegionId,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+ });
+ }
+ }
+ return parameter;
+ };
+
+ var getTenantList = function(cloudRegionId) {
+ var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+ var parameter = "";
+ if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+ parameter = FIELD.PARAMETER.TENANT_ENABLED;
+ parameter.optionList = new Array();
+ for (var i = 0; i < cloudRegionTenantList.length; i++) {
+ if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
+ parameter.optionList.push({
+ id : cloudRegionTenantList[i].tenantId,
+ name : cloudRegionTenantList[i].tenantName,
isPermitted : cloudRegionTenantList[i].isPermitted
});
- }
- }
- }
- return parameter;
-
- };
-
- var addOptionList = function(parameter, optionSimpleArray) {
- var optionList = new Array();
- if (!angular.isArray(optionSimpleArray)) {
- return optionList;
- }
- for (var i = 0; i < optionSimpleArray.length; i++) {
- optionList.push({
- name : optionSimpleArray[i],
+ }
+ }
+ }
+ return parameter;
+
+ };
+
+ var addOptionList = function(parameter, optionSimpleArray) {
+ var optionList = new Array();
+ if (!angular.isArray(optionSimpleArray)) {
+ return optionList;
+ }
+ for (var i = 0; i < optionSimpleArray.length; i++) {
+ optionList.push({
+ name : optionSimpleArray[i],
isPermitted :true,
- });
- }
- parameter.optionList = optionList;
- return parameter;
- };
-
- var getValueFromList = function(id, parameterList) {
- for (var i = 0; i < parameterList.length; i++) {
- if (parameterList[i].id === id) {
- return parameterList[i].value;
- }
- }
- };
- var updateUserParameterList = function(updatedId, parameterListControl) {
- console.log ("updateUserParameterList() updatedId=" + updatedId);
- if (updatedId === FIELD.ID.PRODUCT_FAMILY && DataService.getHideServiceFields()) {
- var cloudRegionTenantList = new Array();
- AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
- DataService.setCloudRegionTenantList(cloudRegionTenantList);
- parameterListControl.updateList([ getLcpRegion() ]);
- });
- }else if (updatedId === FIELD.ID.SDN_C_PRELOAD) {
- var list = parameterListControl.getList(updatedId);
- if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
- FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true;
- parameterListControl
- .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED ]);
- }else{
- parameterListControl
- .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_UNCHECKED ]);
- }
- }else if (updatedId === FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE) {
- if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
- $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').show();
- FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=true;
- parameterListControl
- .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
- }else{
- $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
- FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=false;
- parameterListControl
- .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
- }
- } else if (updatedId === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {
- var filePath = $('input[parameter-id="'+updatedId+'"]').val();
- var arr =filePath.split('.');
- var fileExt = arr[arr.length-1];
- if(fileExt!='' && fileExt.toLowerCase()!='json'){
- $('input[parameter-id="'+updatedId+'"]').val('');
- alert("Invalid file format. Please select *.json format file.");
- return false;
- }
- } else if (updatedId === FIELD.ID.LCP_REGION) {
- var list = parameterListControl.getList(updatedId);
- if (list[0].selectedIndex >= 0) {
- parameterListControl
- .updateList([ getTenantList(list[0].value) ]);
- } else {
- parameterListControl
- .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
- }
- if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
- parameterListControl
- .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
- } else {
- parameterListControl
- .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
- }
- } else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
- var list = parameterListControl.getList(updatedId);
- if (list[0].selectedIndex >= 0) {
- DataService.setGlobalCustomerId(list[0].value);
-
- AaiService.getSubscriptionServiceTypeList(DataService
- .getGlobalCustomerId(), function(response) {
- DataService.setSubscriptionServiceTypeList(response);
- var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
- serviceTypeParameters.optionList = [];
-
- for (var i = 0; i < response.length; i++) {
- serviceTypeParameters.optionList.push({
- "id" : response[i].name,
- "name" : response[i].name,
+ });
+ }
+ parameter.optionList = optionList;
+ return parameter;
+ };
+
+ var getValueFromList = function(id, parameterList) {
+ for (var i = 0; i < parameterList.length; i++) {
+ if (parameterList[i].id === id) {
+ return parameterList[i].value;
+ }
+ }
+ };
+ var updateUserParameterList = function(updatedId, parameterListControl) {
+ console.log ("updateUserParameterList() updatedId=" + updatedId);
+ if (updatedId === FIELD.ID.PRODUCT_FAMILY && DataService.getHideServiceFields()) {
+ var cloudRegionTenantList = new Array();
+ AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
+ DataService.setCloudRegionTenantList(cloudRegionTenantList);
+ parameterListControl.updateList([ getLcpRegionParameter() ]);
+ });
+ }else if (updatedId === FIELD.ID.SDN_C_PRELOAD) {
+ var list = parameterListControl.getList(updatedId);
+ if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
+ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED.value=true;
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_CHECKED ]);
+ }else{
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SDN_C_PRELOAD_UNCHECKED ]);
+ }
+ }else if (updatedId === FIELD.ID.UPLOAD_SUPPLEMENTORY_DATA_FILE) {
+ if($('input[parameter-id="'+updatedId+'"]').is(':checked')){
+ $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').show();
+ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=true;
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED ]);
+ }else{
+ $('input[parameter-id="'+FIELD.ID.SUPPLEMENTORY_DATA_FILE+'"]').closest('tr').hide();
+ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_CHECKED.value=false;
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.UPLOAD_SUPPLEMENTORY_DATA_FILE_UNCHECKED ]);
+ }
+ } else if (updatedId === FIELD.ID.SUPPLEMENTORY_DATA_FILE) {
+ var filePath = $('input[parameter-id="'+updatedId+'"]').val();
+ var arr =filePath.split('.');
+ var fileExt = arr[arr.length-1];
+ if(fileExt!='' && fileExt.toLowerCase()!='json'){
+ $('input[parameter-id="'+updatedId+'"]').val('');
+ alert("Invalid file format. Please select *.json format file.");
+ return false;
+ }
+ } else if (updatedId === FIELD.ID.LCP_REGION) {
+ var list = parameterListControl.getList(updatedId);
+ if (list[0].selectedIndex >= 0) {
+ parameterListControl
+ .updateList([ getTenantList(list[0].value) ]);
+ } else {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
+ }
+ if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
+ } else {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
+ }
+ } else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
+ var list = parameterListControl.getList(updatedId);
+ if (list[0].selectedIndex >= 0) {
+ DataService.setGlobalCustomerId(list[0].value);
+
+ AaiService.getSubscriptionServiceTypeList(DataService
+ .getGlobalCustomerId(), function(response) {
+ DataService.setSubscriptionServiceTypeList(response);
+ var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
+ serviceTypeParameters.optionList = [];
+
+ for (var i = 0; i < response.length; i++) {
+ serviceTypeParameters.optionList.push({
+ "id" : response[i].name,
+ "name" : response[i].name,
"isPermitted" :response[i].isPermitted
});
- }
- console.log ( "updateUserParameterList: service type parameters " );
- console.log ( JSON.stringify (serviceTypeParameters, null, 4));
- parameterListControl.updateList([ serviceTypeParameters ]);
- });
-
- }
- } else if ( updatedId === FIELD.ID.SERVICE_TYPE ) {
- var list = parameterListControl.getList(updatedId);
- if (list[0].selectedIndex >= 0) {
-
- DataService.setServiceType(list[0].value);
- var cloudRegionTenantList = new Array();
- AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
- DataService.setCloudRegionTenantList(cloudRegionTenantList);
- parameterListControl.updateList([ getLcpRegion() ]);
- });
- } else {
- parameterListControl
- .updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
- }
- }
-
- };
-
- return {
- initializeComponent : function(componentId) {
- _this.componentId = ComponentService.initialize(componentId);
- },
- setHttpErrorHandler : function(httpErrorHandler) {
- _this.httpErrorHandler = httpErrorHandler;
- },
- getComponentDisplayName : ComponentService.getComponentDisplayName,
- getParameters : function(getParametersHandler) {
- _this.getParametersHandler = getParametersHandler;
- UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
- UtilityService.startAsyncOperations(getAsyncOperationList(),
- internalGetParametersHandler);
- },
- updateUserParameterList : updateUserParameterList,
- getMsoRequestDetails : getMsoRequestDetails,
- getMsoUrl : getMsoUrl
- }
+ }
+ console.log ( "updateUserParameterList: service type parameters " );
+ console.log ( JSON.stringify (serviceTypeParameters, null, 4));
+ parameterListControl.updateList([ serviceTypeParameters ]);
+ });
+
+ }
+ } else if ( updatedId === FIELD.ID.SERVICE_TYPE ) {
+ var list = parameterListControl.getList(updatedId);
+ if (list[0].selectedIndex >= 0) {
+
+ DataService.setServiceType(list[0].value);
+ var cloudRegionTenantList = new Array();
+ AaiService.getLcpCloudRegionTenantList(DataService.getGlobalCustomerId(), DataService.getServiceType(), function(cloudRegionTenantList) {
+ DataService.setCloudRegionTenantList(cloudRegionTenantList);
+ parameterListControl.updateList([ getLcpRegionParameter() ]);
+ });
+ } else {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+ }
+ }
+
+ };
+
+ return {
+ initializeComponent : function(componentId) {
+ _this.componentId = ComponentService.initialize(componentId);
+ },
+ setHttpErrorHandler : function(httpErrorHandler) {
+ _this.httpErrorHandler = httpErrorHandler;
+ },
+ getComponentDisplayName : ComponentService.getComponentDisplayName,
+ getParameters : function(getParametersHandler) {
+ _this.getParametersHandler = getParametersHandler;
+ UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
+ UtilityService.startAsyncOperations(getAsyncOperationList(),
+ internalGetParametersHandler);
+ },
+ updateUserParameterList : updateUserParameterList,
+ getMsoRequestDetails : getMsoRequestDetails,
+ getMsoUrl : getMsoUrl,
+ setInventoryInfo: setInventoryInfo
+ }
}
appDS2.factory("CreationService", [ "$log", "AaiService", "AsdcService",
- "DataService","VIDCONFIGURATION", "ComponentService", "COMPONENT", "FIELD", "PARAMETER",
- "UtilityService", CreationService ]);
+ "DataService","VIDCONFIGURATION", "ComponentService", "COMPONENT", "FIELD", "PARAMETER",
+ "UtilityService", "OwningEntityService", CreationService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
index 2d7fa6ca7..716854edb 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/dataService.js
@@ -100,6 +100,12 @@ var DataService = function($log, DataService) {
getAicZones : function(){
return _this.aicZones;
},
+ setAicZoneForPNF: function(aicZone) {
+ _this.aicZone = aicZone;
+ },
+ getAicZoneForPNF : function(){
+ return _this.aicZone;
+ },
getServiceInstanceId : function() {
return _this.serviceInstanceId;
},
@@ -214,6 +220,12 @@ var DataService = function($log, DataService) {
setVnfInstanceId : function(vnfInstanceId) {
_this.vnfInstanceId = vnfInstanceId;
},
+ getVfModuleInstanceName : function() {
+ return _this.vfModuleInstanceName;
+ },
+ setVfModuleInstanceName : function(vfModuleInstanceName) {
+ _this.vfModuleInstanceName = vfModuleInstanceName;
+ },
getVolumeGroupInstanceId : function() {
return _this.volumeGroupInstanceId;
},
@@ -293,8 +305,81 @@ var DataService = function($log, DataService) {
},
getHideServiceFields:function(){
return _this.hideServiceFields;
- }
+ },
+ getServiceProxies:function(){
+ return _this.serviceProxies;
+ },
+ setServiceProxies:function(serviceProxies){
+ _this.serviceProxies = serviceProxies;
+ },
+ getSourceServiceProxies:function(){
+ return _this.sourceServiceProxies;
+ },
+ setSourceServiceProxies:function(sourceServiceProxies){
+ _this.sourceServiceProxies = sourceServiceProxies;
+ },
+ getCollectorServiceProxies:function(){
+ return _this.collectorServiceProxies;
+ },
+ setCollectorServiceProxies:function(collectorServiceProxies){
+ _this.collectorServiceProxies = collectorServiceProxies;
+ },
+ getConfigurationByPolicy:function() {
+ return _this.configurationByPolicy;
+ },
+ setConfigurationByPolicy:function (configurationByPolicy) {
+ _this.configurationByPolicy = configurationByPolicy;
+ },
+ getSuppressRollback:function(){
+ return _this.suppressRollback;
+ },
+ setSuppressRollback:function(suppressRollback){
+ _this.suppressRollback = suppressRollback;
+ },
+ getPortMirroningConfigFields:function(){
+ return _this.portMirroningConfigFields;
+ },
+ setPortMirroningConfigFields:function(portMirroningConfigFields){
+ _this.portMirroningConfigFields = portMirroningConfigFields;
+ },
+ getConfigurationInstanceId : function() {
+ return _this.configurationInstanceId;
+ },
+ setConfigurationInstanceId : function(configurationInstanceId) {
+ _this.configurationInstanceId = configurationInstanceId;
+ },
+ getConfigurationStatus: function () {
+ return _this.configurationStatus;
+ },
+ setConfigurationStatus: function (configurationStatus) {
+ _this.configurationStatus = configurationStatus;
+ },
+ getPortStatus: function () {
+ return _this.portStatus;
+ },
+ setPortStatus: function (portStatus) {
+ _this.portStatus = portStatus;
+ },
+ getPortId: function () {
+ return _this.portId;
+ },
+ setPortId: function (portId) {
+ _this.portId = portId;
+ },
+ getPnf: function () {
+ return _this.pnf;
+ },
+ setPnf: function (pnf) {
+ _this.pnf = pnf;
+ },
+ getOwningEntityProperties: function () {
+ return _this.owningEntityProperties;
+ },
+ setOwningEntityProperties: function (properties) {
+ _this.owningEntityProperties = properties;
+ }
+
}
-}
+};
appDS2.factory("DataService", [ "$log", DataService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
index 79282997b..90daf3550 100755..100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/deletionService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/deleteResumeService.js
@@ -1,508 +1,518 @@
-/*-
- * ============LICENSE_START=======================================================
- * VID
- * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- * ================================================================================
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================
- */
-
-"use strict";
-
-var DeletionService = function($log, AaiService, AsdcService, DataService,
- ComponentService, COMPONENT, FIELD, UtilityService) {
-
- var _this = this;
-
- var getAsyncOperationList = function() {
- if (DataService.getLoggedInUserId() == null)
- getLoggedInUserID();
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- return [ getSubscribers, getLcpCloudRegionTenantList ];
- case COMPONENT.NETWORK:
- return [ getLcpCloudRegionTenantList ];
- case COMPONENT.VNF:
- return [ getLcpCloudRegionTenantList ];
- case COMPONENT.VF_MODULE:
- return [ getLcpCloudRegionTenantList ];
- case COMPONENT.VOLUME_GROUP:
- return [ getLcpCloudRegionTenantList ];
- }
- };
-
- var getLcpCloudRegionTenantList = function() {
- //console.log ( "global customer id: " );
- //console.log ( JSON.stringify (DataService.getGlobalCustomerId()) );
-
- //console.log ( "service type: " );
- //console.log ( JSON.stringify (DataService.getServiceType()) );
-
- AaiService.getLcpCloudRegionTenantList(DataService
- .getGlobalCustomerId(), DataService.getServiceType(), function(
- response) {
- DataService.setCloudRegionTenantList(response);
- UtilityService.startNextAsyncOperation();
- });
- };
-
- var getLoggedInUserID = function() {
- AaiService.getLoggedInUserID(function(response) {
- DataService.setLoggedInUserId(response.data);
- UtilityService.startNextAsyncOperation();
- });
- };
-
- var getSubscribers = function() {
- AaiService.getSubscribers(function(response) {
- DataService.setSubscribers(response);
- UtilityService.startNextAsyncOperation();
- });
- };
-
- var internalGetParametersHandler = function() {
- if (angular.isFunction(_this.getParametersHandler)) {
- if (_this.componentId == COMPONENT.SERVICE) {
- if ( DataService.getALaCarte() ) {
- _this.getParametersHandler({
- summaryList : getSummaryList(),
- userProvidedList : getUserProvidedList()
- }, true);
- }
- else {
- _this.getParametersHandler({
- summaryList : getSummaryList(),
- userProvidedList : getUserProvidedList()
- }, false);
- }
- }
- else {
- _this.getParametersHandler({
- summaryList : getSummaryList(),
- userProvidedList : getUserProvidedList()
- }, false);
- }
- }
- };
-
- var getSubscribersParameter = function() {
- var subscribers = DataService.getSubscribers();
- var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
- parameter.optionList = [];
-
- for (var i = 0; i < subscribers.length; i++) {
- parameter.optionList.push({
- id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
- name : subscribers[i][FIELD.ID.SUBNAME]
- })
- }
- return parameter;
- };
-
- var getServiceId = function() {
- var serviceIdList = DataService.getServiceIdList();
- var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
- parameter.optionList = new Array();
- for (var i = 0; i < serviceIdList.length; i++) {
- parameter.optionList.push({
- id : serviceIdList[i].id,
- name : serviceIdList[i].description
- });
- }
- return parameter;
- };
-
- var getUserProvidedList = function() {
-
- //var parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
-
- var parameterList = [];
-
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- if ( DataService.getALaCarte() ) {
- parameterList = [];
- }
- else {
- parameterList = parameterList.concat ([getLcpRegion(),
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
- }
- break;
- case COMPONENT.NETWORK:
- case COMPONENT.VNF:
- parameterList = parameterList.concat([ //getServiceId(),
- getLcpRegion(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
- break;
- case COMPONENT.VF_MODULE:
- parameterList = parameterList.concat([
- getLcpRegion(),
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED
- ]);
-
- break;
- case COMPONENT.VOLUME_GROUP:
- parameterList = parameterList.concat([ getLcpRegion(),
- FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
- FIELD.PARAMETER.TENANT_DISABLED ]);
- }
-
- //parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
-
- //addArbitraryParameters(parameterList);
-
- return parameterList;
- };
- var getSummaryList = function() {
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- case COMPONENT.SERVICE:
- case COMPONENT.VNF:
- case COMPONENT.VF_MODULE:
- case COMPONENT.VOLUME_GROUP:
- var summaryList = [ {
- name : FIELD.NAME.SUBSCRIBER_NAME,
- value : DataService.getSubscriberName()
- }, {
- name : FIELD.NAME.CUSTOMER_ID,
- value : DataService.getGlobalCustomerId()
- }, {
- name : FIELD.NAME.SERVICE_UUID,
- value : DataService.getServiceUuid()
- }, {
- name : FIELD.NAME.SERVICE_NAME,
- value : DataService.getServiceName()
- /* }, {
- name : FIELD.NAME.USER_SERVICE_INSTANCE_NAME,
- value : DataService.getUserServiceInstanceName()*/
- } ];
-
- _this.parameterList = new Array();
-
- addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
-
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.SERVICE_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.SERVICE_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
- addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
- break;
- case COMPONENT.VF_MODULE:
- addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
- .getSubscriberName());
- addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
- .getServiceInstanceName());
- addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
- addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.MODEL_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.MODEL_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- break;
- case COMPONENT.NETWORK:
- case COMPONENT.VNF:
- case COMPONENT.VOLUME_GROUP:
- addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
- .getSubscriberName());
- addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
- .getServiceInstanceName());
- addToList(FIELD.NAME.MODEL_NAME, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
- addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
- addToList(FIELD.NAME.MODEL_VERSION, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
- addToList(FIELD.NAME.MODEL_UUID, DataService
- .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
- break;
- }
-
- /*var additionalList = ComponentService.getInventoryParameterList(
- _this.componentId, DataService.getInventoryItem());*/
- var additionalList = ComponentService.getDisplayNames(ComponentService
- .getInventoryParameterList(_this.componentId, DataService
- .getInventoryItem(), true ));
-
- return summaryList.concat(ComponentService
- .getDisplayNames(additionalList));
- }
- };
-
- var getMsoUrl = function() {
- switch (_this.componentId) {
- case COMPONENT.NETWORK:
- return "mso_delete_nw_instance/"
- + DataService.getServiceInstanceId() + "/networks/"
- + DataService.getNetworkInstanceId();
- case COMPONENT.SERVICE:
- return "mso_delete_svc_instance/"
- + DataService.getServiceInstanceId();
- case COMPONENT.VNF:
- return "mso_delete_vnf_instance/"
- + DataService.getServiceInstanceId() + "/vnfs/"
- + DataService.getVnfInstanceId();
- case COMPONENT.VF_MODULE:
- return "mso_delete_vfmodule_instance/"
- + DataService.getServiceInstanceId() + "/vnfs/"
- + DataService.getVnfInstanceId() + "/vfModules/"
- + DataService.getVfModuleInstanceId();
- case COMPONENT.VOLUME_GROUP:
- return "mso_delete_volumegroup_instance/"
- + DataService.getServiceInstanceId() + "/vnfs/"
- + DataService.getVnfInstanceId() + "/volumeGroups/"
- + DataService.getVolumeGroupInstanceId();
- }
- }
-
- var addToList = function(name, value) {
- _this.parameterList.push({
- name : name,
- value : value
- });
- };
-
- var getMsoRequestDetails = function(parameterList) {
- console.log("getMsoRequestDetails invoked");
- var inventoryInfo = ComponentService.getInventoryInfo(
- _this.componentId, DataService.getInventoryItem());
- var modelInfo = DataService.getModelInfo(_this.componentId);
- var requestorloggedInId = DataService.getLoggedInUserId();
- if (requestorloggedInId == null)
- requestorloggedInId = "";
- var requestDetails = {
- modelInfo : {
- modelType : _this.componentId,
- modelInvariantId : modelInfo.modelInvariantId,
- modelVersionId : modelInfo.modelNameVersionId,
- modelName : modelInfo.modelName,
- modelCustomizationName : modelInfo.modelCustomizationName,
- modelCustomizationId : modelInfo.customizationUuid,
- modelVersion : modelInfo.modelVersion
- },
- requestInfo : {
- source : FIELD.ID.VID,
- requestorId: requestorloggedInId
- }
- };
-
- switch (_this.componentId) {
- case COMPONENT.SERVICE:
- requestDetails.requestParameters = {
- aLaCarte : DataService.getALaCarte()
- };
- if ( !(DataService.getALaCarte()) ) {
- // for macro delete include cloud config.
- var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
- lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
- parameterList);
- }
- requestDetails.cloudConfiguration = {
- lcpCloudRegionId : lcpRegion,
- tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
- };
- }
- break;
- case COMPONENT.VNF:
- console.log("getMsoRequestDetails COMPONENT.VNF");
- var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
- lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
- parameterList);
- }
- requestDetails.cloudConfiguration = {
- lcpCloudRegionId : lcpRegion,
- tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
- };
-
- break;
- case COMPONENT.VF_MODULE:
- case COMPONENT.NETWORK:
- var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
- lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
- parameterList);
- }
- requestDetails.cloudConfiguration = {
- lcpCloudRegionId : lcpRegion,
- tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
- };
- break;
- case COMPONENT.VOLUME_GROUP:
- var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
- if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
- lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
- parameterList);
- }
- requestDetails.cloudConfiguration = {
- lcpCloudRegionId : lcpRegion,
- tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
- };
-
- break;
- default:
- requestDetails.cloudConfiguration = {
- lcpCloudRegionId : DataService.getLcpRegion(),
- tenantId : DataService.getTenant()
- };
- }
- return requestDetails;
- }
-
- var getLcpRegion = function() {
- var cloudRegionTenantList = DataService.getCloudRegionTenantList();
- var parameter = "";
- if ( UtilityService.hasContents (cloudRegionTenantList) ) {
- parameter = FIELD.PARAMETER.LCP_REGION;
- parameter.optionList = new Array();
- for (var i = 0; i < cloudRegionTenantList.length; i++) {
- for (var j = 0; j < parameter.optionList.length; j++) {
- if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
- parameter.optionList[j].isPermitted =
- parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
- break;
- }
- }
- if (j < parameter.optionList.length) {
- continue;
- }
- parameter.optionList.push({
- id : cloudRegionTenantList[i].cloudRegionId,
- isPermitted : cloudRegionTenantList[i].isPermitted
-
- });
- }
- }
- return parameter;
- };
-
- var getTenantList = function(cloudRegionId) {
- var parameter = "";
- var cloudRegionTenantList = DataService.getCloudRegionTenantList();
- if ( UtilityService.hasContents (cloudRegionTenantList) ) {
- var parameter = FIELD.PARAMETER.TENANT_ENABLED;
- parameter.optionList = new Array();
- for (var i = 0; i < cloudRegionTenantList.length; i++) {
- if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
- parameter.optionList.push({
- id : cloudRegionTenantList[i].tenantId,
- name : cloudRegionTenantList[i].tenantName,
- isPermitted : cloudRegionTenantList[i].isPermitted
- });
- }
- }
- }
- return parameter;
-
- };
-
- var addOptionList = function(parameter, optionSimpleArray) {
- var optionList = new Array();
- if (!angular.isArray(optionSimpleArray)) {
- return optionList;
- }
- for (var i = 0; i < optionSimpleArray.length; i++) {
- optionList.push({
- name : optionSimpleArray[i]
- });
- }
- parameter.optionList = optionList;
- return parameter;
- };
-
- var getValueFromList = function(id, parameterList) {
- for (var i = 0; i < parameterList.length; i++) {
- if (parameterList[i].id === id) {
- return parameterList[i].value;
- }
- }
- };
-
- var updateUserParameterList = function(updatedId, parameterListControl) {
- if (updatedId === FIELD.ID.LCP_REGION) {
- var list = parameterListControl.getList(updatedId);
- if (list[0].selectedIndex >= 0) {
- parameterListControl
- .updateList([ getTenantList(list[0].value) ]);
- } else {
- parameterListControl
- .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
- }
- if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
- parameterListControl
- .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
- } else {
- parameterListControl
- .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
- }
- } else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
- var list = parameterListControl.getList(updatedId);
- if (list[0].selectedIndex >= 0) {
- DataService.setGlobalCustomerId(list[0].value);
-
- AaiService.getSubscriptionServiceTypeList(DataService
- .getGlobalCustomerId(), function(response) {
- DataService.setSubscriptionServiceTypeList(response);
- var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
- serviceTypeParameters.optionList = [];
-
- for (var i = 0; i < response.length; i++) {
- serviceTypeParameters.optionList.push({
- "id" : response[i].name,
- "name" : response[i].name
- });
- }
- parameterListControl.updateList([ serviceTypeParameters ]);
- });
-
- } else {
- parameterListControl
- .updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
- }
- }
- };
-
- return {
- initializeComponent : function(componentId) {
- _this.componentId = ComponentService.initialize(componentId);
- },
- getComponentDisplayName : ComponentService.getComponentDisplayName,
- getSummaryList : getSummaryList,
- getParameters : function(getParametersHandler) {
- _this.getParametersHandler = getParametersHandler;
- UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
- UtilityService.startAsyncOperations(getAsyncOperationList(),
- internalGetParametersHandler);
- },
- updateUserParameterList : updateUserParameterList,
- getMsoRequestDetails : getMsoRequestDetails,
- getMsoUrl : getMsoUrl,
- isMacro : DataService.getMacro()
- }
-}
-
-appDS2.factory("DeletionService", [ "$log", "AaiService", "AsdcService",
- "DataService", "ComponentService", "COMPONENT", "FIELD",
- "UtilityService", DeletionService ]);
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var DeleteResumeService = function($log, AaiService, AsdcService, DataService,
+ ComponentService, COMPONENT, FIELD, UtilityService) {
+
+ var _this = this;
+
+ var getAsyncOperationList = function() {
+ if (DataService.getLoggedInUserId() == null)
+ getLoggedInUserID();
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ return [ getSubscribers, getLcpCloudRegionTenantList ];
+ case COMPONENT.NETWORK:
+ return [ getLcpCloudRegionTenantList ];
+ case COMPONENT.VNF:
+ return [ getLcpCloudRegionTenantList ];
+ case COMPONENT.VF_MODULE:
+ return [ getLcpCloudRegionTenantList ];
+ case COMPONENT.VOLUME_GROUP:
+ return [ getLcpCloudRegionTenantList ];
+ case COMPONENT.CONFIGURATION:
+ return [ getLcpCloudRegionTenantList ];
+ }
+ };
+
+ var getLcpCloudRegionTenantList = function() {
+ //console.log ( "global customer id: " );
+ //console.log ( JSON.stringify (DataService.getGlobalCustomerId()) );
+
+ //console.log ( "service type: " );
+ //console.log ( JSON.stringify (DataService.getServiceType()) );
+
+ AaiService.getLcpCloudRegionTenantList(DataService
+ .getGlobalCustomerId(), DataService.getServiceType(), function(
+ response) {
+ DataService.setCloudRegionTenantList(response);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var getLoggedInUserID = function() {
+ AaiService.getLoggedInUserID(function(response) {
+ DataService.setLoggedInUserId(response.data);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var getSubscribers = function() {
+ AaiService.getSubscribers(function(response) {
+ DataService.setSubscribers(response);
+ UtilityService.startNextAsyncOperation();
+ });
+ };
+
+ var internalGetParametersHandler = function() {
+ if (angular.isFunction(_this.getParametersHandler)) {
+ if (_this.componentId == COMPONENT.SERVICE) {
+ if ( DataService.getALaCarte() ) {
+ _this.getParametersHandler({
+ summaryList : getSummaryList(),
+ userProvidedList : getUserProvidedList()
+ }, true);
+ }
+ else {
+ _this.getParametersHandler({
+ summaryList : getSummaryList(),
+ userProvidedList : getUserProvidedList()
+ }, false);
+ }
+ }
+ else {
+ _this.getParametersHandler({
+ summaryList : getSummaryList(),
+ userProvidedList : getUserProvidedList()
+ }, false);
+ }
+ }
+ };
+
+ var getSubscribersParameter = function() {
+ var subscribers = DataService.getSubscribers();
+ var parameter = FIELD.PARAMETER.SUBSCRIBER_NAME;
+ parameter.optionList = [];
+
+ for (var i = 0; i < subscribers.length; i++) {
+ parameter.optionList.push({
+ id : subscribers[i][FIELD.ID.GLOBAL_CUSTOMER_ID],
+ name : subscribers[i][FIELD.ID.SUBNAME]
+ })
+ }
+ return parameter;
+ };
+
+ var getServiceId = function() {
+ var serviceIdList = DataService.getServiceIdList();
+ var parameter = FIELD.PARAMETER.PRODUCT_FAMILY;
+ parameter.optionList = new Array();
+ for (var i = 0; i < serviceIdList.length; i++) {
+ parameter.optionList.push({
+ id : serviceIdList[i].id,
+ name : serviceIdList[i].description
+ });
+ }
+ return parameter;
+ };
+
+ var getUserProvidedList = function() {
+
+ //var parameterList = [ FIELD.PARAMETER.INSTANCE_NAME ];
+
+ var parameterList = [];
+
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ if ( DataService.getALaCarte() ) {
+ parameterList = [];
+ }
+ else {
+ parameterList = parameterList.concat ([getLcpRegion(),
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED ]);
+ }
+ break;
+ case COMPONENT.NETWORK:
+ case COMPONENT.CONFIGURATION:
+ case COMPONENT.VNF:
+ parameterList = parameterList.concat([ //getServiceId(),
+ getLcpRegion(), FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED ]);
+ break;
+ case COMPONENT.VF_MODULE:
+ parameterList = parameterList.concat([
+ getLcpRegion(),
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED
+ ]);
+
+ break;
+ case COMPONENT.VOLUME_GROUP:
+ parameterList = parameterList.concat([ getLcpRegion(),
+ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN,
+ FIELD.PARAMETER.TENANT_DISABLED ]);
+ }
+
+ //parameterList.push(FIELD.PARAMETER.SUPPRESS_ROLLBACK);
+
+ //addArbitraryParameters(parameterList);
+
+ return parameterList;
+ };
+ var getSummaryList = function() {
+ switch (_this.componentId) {
+ case COMPONENT.CONFIGURATION:
+ case COMPONENT.NETWORK:
+ case COMPONENT.SERVICE:
+ case COMPONENT.VNF:
+ case COMPONENT.VF_MODULE:
+ case COMPONENT.VOLUME_GROUP:
+ var summaryList = [ {
+ name : FIELD.NAME.SUBSCRIBER_NAME,
+ value : DataService.getSubscriberName()
+ }, {
+ name : FIELD.NAME.CUSTOMER_ID,
+ value : DataService.getGlobalCustomerId()
+ }, {
+ name : FIELD.NAME.SERVICE_UUID,
+ value : DataService.getServiceUuid()
+ }, {
+ name : FIELD.NAME.SERVICE_NAME,
+ value : DataService.getServiceName()
+ /* }, {
+ name : FIELD.NAME.USER_SERVICE_INSTANCE_NAME,
+ value : DataService.getUserServiceInstanceName()*/
+ } ];
+
+ _this.parameterList = new Array();
+
+ addToList(FIELD.NAME.SERVICE_NAME, DataService.getServiceName());
+
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ addToList(FIELD.NAME.SERVICE_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.SERVICE_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.SERVICE_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ addToList(FIELD.NAME.SERVICE_DESCRIPTION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.DESCRIPTION]);
+ addToList(FIELD.NAME.SERVICE_CATEGORY, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.CATEGORY]);
+ break;
+ case COMPONENT.VF_MODULE:
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getSubscriberName());
+ addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+ .getServiceInstanceName());
+ addToList(FIELD.NAME.MODEL_NAME, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+ addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.MODEL_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.MODEL_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ break;
+ case COMPONENT.CONFIGURATION:
+ case COMPONENT.NETWORK:
+ case COMPONENT.VNF:
+ case COMPONENT.VOLUME_GROUP:
+ addToList(FIELD.NAME.SUBSCRIBER_NAME, DataService
+ .getSubscriberName());
+ addToList(FIELD.NAME.SERVICE_INSTANCE_NAME, DataService
+ .getServiceInstanceName());
+ addToList(FIELD.NAME.MODEL_NAME, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME]);
+ addToList(FIELD.NAME.MODEL_INVARIANT_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_INVARIANT_ID]);
+ addToList(FIELD.NAME.MODEL_VERSION, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_VERSION]);
+ addToList(FIELD.NAME.MODEL_UUID, DataService
+ .getModelInfo(_this.componentId)[FIELD.ID.MODEL_NAME_VERSION_ID]);
+ break;
+ }
+
+ /*var additionalList = ComponentService.getInventoryParameterList(
+ _this.componentId, DataService.getInventoryItem());*/
+ var additionalList = ComponentService.getDisplayNames(ComponentService
+ .getInventoryParameterList(_this.componentId, DataService
+ .getInventoryItem(), true ));
+
+ return summaryList.concat(ComponentService
+ .getDisplayNames(additionalList));
+ }
+ };
+
+ var getMsoUrl = function() {
+ switch (_this.componentId) {
+ case COMPONENT.CONFIGURATION:
+ return "mso_delete_configuration/"
+ + DataService.getServiceInstanceId() + "/configurations/"
+ + DataService.getConfigurationInstanceId();
+ case COMPONENT.NETWORK:
+ return "mso_delete_nw_instance/"
+ + DataService.getServiceInstanceId() + "/networks/"
+ + DataService.getNetworkInstanceId();
+ case COMPONENT.SERVICE:
+ return "mso_delete_svc_instance/"
+ + DataService.getServiceInstanceId();
+ case COMPONENT.VNF:
+ return "mso_delete_vnf_instance/"
+ + DataService.getServiceInstanceId() + "/vnfs/"
+ + DataService.getVnfInstanceId();
+ case COMPONENT.VF_MODULE:
+ return "mso_delete_vfmodule_instance/"
+ + DataService.getServiceInstanceId() + "/vnfs/"
+ + DataService.getVnfInstanceId() + "/vfModules/"
+ + DataService.getVfModuleInstanceId();
+ case COMPONENT.VOLUME_GROUP:
+ return "mso_delete_volumegroup_instance/"
+ + DataService.getServiceInstanceId() + "/vnfs/"
+ + DataService.getVnfInstanceId() + "/volumeGroups/"
+ + DataService.getVolumeGroupInstanceId();
+ }
+ };
+
+ var addToList = function(name, value) {
+ _this.parameterList.push({
+ name : name,
+ value : value
+ });
+ };
+
+ var getMsoRequestDetails = function(parameterList) {
+ console.log("getMsoRequestDetails invoked");
+ var inventoryInfo = ComponentService.getInventoryInfo(
+ _this.componentId, DataService.getInventoryItem());
+ var modelInfo = DataService.getModelInfo(_this.componentId);
+ var requestorloggedInId = DataService.getLoggedInUserId();
+ if (requestorloggedInId == null)
+ requestorloggedInId = "";
+ var requestDetails = {
+ modelInfo : {
+ modelType : _this.componentId,
+ modelInvariantId : modelInfo.modelInvariantId,
+ modelVersionId : modelInfo.modelNameVersionId,
+ modelName : modelInfo.modelName,
+ modelCustomizationName : modelInfo.modelCustomizationName,
+ modelCustomizationId : modelInfo.customizationUuid,
+ modelVersion : modelInfo.modelVersion
+ },
+ requestInfo : {
+ source : FIELD.ID.VID,
+ requestorId: requestorloggedInId
+ }
+ };
+
+ switch (_this.componentId) {
+ case COMPONENT.SERVICE:
+ requestDetails.requestParameters = {
+ aLaCarte : DataService.getALaCarte()
+ };
+ if ( !(DataService.getALaCarte()) ) {
+ // for macro delete include cloud config.
+ var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+ if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+ lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+ parameterList);
+ }
+ requestDetails.cloudConfiguration = {
+ lcpCloudRegionId : lcpRegion,
+ tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+ };
+ }
+ break;
+ case COMPONENT.VNF:
+ case COMPONENT.CONFIGURATION:
+ console.log("getMsoRequestDetails COMPONENT.VNF");
+ var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+ if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+ lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+ parameterList);
+ }
+ requestDetails.cloudConfiguration = {
+ lcpCloudRegionId : lcpRegion,
+ tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+ };
+
+ break;
+ case COMPONENT.VF_MODULE:
+ case COMPONENT.NETWORK:
+ var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+ if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+ lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+ parameterList);
+ }
+ requestDetails.cloudConfiguration = {
+ lcpCloudRegionId : lcpRegion,
+ tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+ };
+ break;
+ case COMPONENT.VOLUME_GROUP:
+ var lcpRegion = getValueFromList(FIELD.ID.LCP_REGION, parameterList);
+ if (lcpRegion === FIELD.KEY.LCP_REGION_TEXT) {
+ lcpRegion = getValueFromList(FIELD.ID.LCP_REGION_TEXT,
+ parameterList);
+ }
+ requestDetails.cloudConfiguration = {
+ lcpCloudRegionId : lcpRegion,
+ tenantId : getValueFromList(FIELD.ID.TENANT, parameterList)
+ };
+
+ break;
+ default:
+ requestDetails.cloudConfiguration = {
+ lcpCloudRegionId : DataService.getLcpRegion(),
+ tenantId : DataService.getTenant()
+ };
+ }
+ return requestDetails;
+ }
+
+ var getLcpRegion = function() {
+ var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+ var parameter = "";
+ if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+ parameter = FIELD.PARAMETER.LCP_REGION;
+ parameter.optionList = new Array();
+ for (var i = 0; i < cloudRegionTenantList.length; i++) {
+ for (var j = 0; j < parameter.optionList.length; j++) {
+ if (parameter.optionList[j].id === cloudRegionTenantList[i].cloudRegionId) {
+ parameter.optionList[j].isPermitted =
+ parameter.optionList[j].isPermitted || cloudRegionTenantList[i].isPermitted;
+ break;
+ }
+ }
+ if (j < parameter.optionList.length) {
+ continue;
+ }
+ parameter.optionList.push({
+ id : cloudRegionTenantList[i].cloudRegionId,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+
+ });
+ }
+ }
+ return parameter;
+ };
+
+ var getTenantList = function(cloudRegionId) {
+ var parameter = "";
+ var cloudRegionTenantList = DataService.getCloudRegionTenantList();
+ if ( UtilityService.hasContents (cloudRegionTenantList) ) {
+ var parameter = FIELD.PARAMETER.TENANT_ENABLED;
+ parameter.optionList = new Array();
+ for (var i = 0; i < cloudRegionTenantList.length; i++) {
+ if (cloudRegionTenantList[i].cloudRegionId === cloudRegionId) {
+ parameter.optionList.push({
+ id : cloudRegionTenantList[i].tenantId,
+ name : cloudRegionTenantList[i].tenantName,
+ isPermitted : cloudRegionTenantList[i].isPermitted
+ });
+ }
+ }
+ }
+ return parameter;
+
+ };
+
+ var addOptionList = function(parameter, optionSimpleArray) {
+ var optionList = new Array();
+ if (!angular.isArray(optionSimpleArray)) {
+ return optionList;
+ }
+ for (var i = 0; i < optionSimpleArray.length; i++) {
+ optionList.push({
+ name : optionSimpleArray[i]
+ });
+ }
+ parameter.optionList = optionList;
+ return parameter;
+ };
+
+ var getValueFromList = function(id, parameterList) {
+ for (var i = 0; i < parameterList.length; i++) {
+ if (parameterList[i].id === id) {
+ return parameterList[i].value;
+ }
+ }
+ };
+
+ var updateUserParameterList = function(updatedId, parameterListControl) {
+ if (updatedId === FIELD.ID.LCP_REGION) {
+ var list = parameterListControl.getList(updatedId);
+ if (list[0].selectedIndex >= 0) {
+ parameterListControl
+ .updateList([ getTenantList(list[0].value) ]);
+ } else {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.TENANT_DISABLED ]);
+ }
+ if (list[0].value === FIELD.KEY.LCP_REGION_TEXT) {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_VISIBLE ]);
+ } else {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.LCP_REGION_TEXT_HIDDEN ]);
+ }
+ } else if (updatedId === FIELD.ID.SUBSCRIBER_NAME) {
+ var list = parameterListControl.getList(updatedId);
+ if (list[0].selectedIndex >= 0) {
+ DataService.setGlobalCustomerId(list[0].value);
+
+ AaiService.getSubscriptionServiceTypeList(DataService
+ .getGlobalCustomerId(), function(response) {
+ DataService.setSubscriptionServiceTypeList(response);
+ var serviceTypeParameters = FIELD.PARAMETER.SERVICE_TYPE;
+ serviceTypeParameters.optionList = [];
+
+ for (var i = 0; i < response.length; i++) {
+ serviceTypeParameters.optionList.push({
+ "id" : response[i].name,
+ "name" : response[i].name
+ });
+ }
+ parameterListControl.updateList([ serviceTypeParameters ]);
+ });
+
+ } else {
+ parameterListControl
+ .updateList([ FIELD.PARAMETER.SERVICE_TYPE_DISABLED ]);
+ }
+ }
+ };
+
+ return {
+ initializeComponent : function(componentId) {
+ _this.componentId = ComponentService.initialize(componentId);
+ },
+ getComponentDisplayName : ComponentService.getComponentDisplayName,
+ getSummaryList : getSummaryList,
+ getParameters : function(getParametersHandler) {
+ _this.getParametersHandler = getParametersHandler;
+ UtilityService.setHttpErrorHandler(_this.httpErrorHandler);
+ UtilityService.startAsyncOperations(getAsyncOperationList(),
+ internalGetParametersHandler);
+ },
+ updateUserParameterList : updateUserParameterList,
+ getMsoRequestDetails : getMsoRequestDetails,
+ getMsoUrl : getMsoUrl,
+ isMacro : DataService.getMacro()
+ }
+}
+
+appDS2.factory("DeleteResumeService", [ "$log", "AaiService", "AsdcService",
+ "DataService", "ComponentService", "COMPONENT", "FIELD",
+ "UtilityService", DeleteResumeService ]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
index 68c8503dc..67211d48b 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/msoService.js
@@ -20,7 +20,7 @@
"use strict";
-var MsoService = function($http, $log, PropertyService, AaiService, UtilityService, COMPONENT, FIELD, $q) {
+var MsoService = function($http, $log, $q, PropertyService, AaiService, UtilityService, COMPONENT, FIELD) {
var _this = this;
@@ -55,49 +55,60 @@ var MsoService = function($http, $log, PropertyService, AaiService, UtilityServi
}
};
- var activateInstance = function(instance, model) {
- var deferred = $q.defer();
+ var buildPayloadForServiceActivateDeactivate = function (model, userId, aicZone) {
+ var requestDetails = {
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": model.service.invariantUuid,
+ "modelVersionId": model.service.uuid,
+ "modelName": model.service.name,
+ "modelVersion": model.service.version
+ },
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": userId
+ },
+ "requestParameters": {
+ "userParams": [{
+ "name": "aic_zone",
+ "value": aicZone
+ }]
+ }
+ };
- AaiService.getLoggedInUserID(function (response) {
- var userID = response.data;
+ $log.debug("Service Activate/Deactivate payload", requestDetails);
- AaiService.getAicZoneForPNF(instance.globalCustomerId, model.service.serviceType, instance.serviceInstanceId, function (aicZone) {
+ return requestDetails;
- var requestDetails = {
- "modelInstanceId": serviceInstanceId,
- "requestDetails": {
- "modelInfo": {
- "modelType": "service",
- "modelInvariantId": model.service.invariantUuid,
- "modelVersionId": model.service.uuid,
- "modelName": model.service.name,
- "modelVersion": model.service.version
- },
- "requestInfo": {
- "source": "VID",
- "requestorId": userID
- },
- "requestParameters": {
- "userParams": {
- "name": "aic_zone",
- "value": aicZone
- }
- }
- }
- };
+ };
- console.log("requestDetails", requestDetails);
+ var activateInstance = function(requestParams) {
+ var requestDetails = buildPayloadForServiceActivateDeactivate(requestParams.model, requestParams.userId, requestParams.aicZone);
- $http.post(COMPONENT.MSO_ACTIVATE_INSTANCE.replace('@serviceInstanceId', requestDetails.modelInstanceId),
- requestDetails.requestDetails)
- .success(function (response) {
- deferred.resolve({data: response});
- })
- .error(function(data, status, headers, config) {
- deferred.reject({message: data, status: status});
- });
+ return sendPostRequest(COMPONENT.MSO_ACTIVATE_INSTANCE.replace('@serviceInstanceId', requestParams.instance.serviceInstanceId),
+ requestDetails);
+ };
+
+ var deactivateInstance = function(requestParams) {
+ var requestDetails = buildPayloadForServiceActivateDeactivate(requestParams.model, requestParams.userId, requestParams.aicZone);
+
+ return sendPostRequest(COMPONENT.MSO_DEACTIVATE_INSTANCE.replace('@serviceInstanceId', requestParams.instance.serviceInstanceId),
+ requestDetails);
+ };
+
+ var sendPostRequest = function(url, requestDetails) {
+ var deferred = $q.defer();
+ if (url) {
+ $http.post(url, {
+ requestDetails: requestDetails
+ }, {
+ timeout: PropertyService.getServerResponseTimeoutMsec()
+ }).success(function (response) {
+ deferred.resolve({data: response});
+ }).error(function (data, status) {
+ deferred.reject({message: data, status: status});
});
- });
+ }
return deferred.promise;
};
@@ -177,9 +188,12 @@ var MsoService = function($http, $log, PropertyService, AaiService, UtilityServi
getFormattedSingleGetOrchestrationRequestResponse : function (response) {
UtilityService.checkUndefined(COMPONENT.ENTITY, response.data.entity);
UtilityService.checkUndefined(COMPONENT.STATUS, response.data.status);
- checkValidStatus(response);
+ //checkValidStatus(response);
var message = "";
+ if (! (response && response.data && response.data.entity)) {
+ return message;
+ }
if ( UtilityService.hasContents (response.data.entity.request) ) {
var request = response.data.entity.request;
message += addListEntry(FIELD.ID.REQUEST_ID, request.requestId) + ",\n";
@@ -201,6 +215,11 @@ var MsoService = function($http, $log, PropertyService, AaiService, UtilityServi
+ "\n\n";
}
}
+ else {
+ if (UtilityService.hasContents(response.data.status) && UtilityService.hasContents(response.data.entity)) {
+ message = this.getFormattedCommonResponse(response) + "\n";
+ }
+ }
return message;
},
getManualTasks : function(requestId) {
@@ -215,29 +234,37 @@ var MsoService = function($http, $log, PropertyService, AaiService, UtilityServi
.catch(UtilityService.runHttpErrorHandler);
},
completeTask: function(taskId, taskToComplete) {
- $log.debug("MsoService:completeTask: taskId: "
- + taskId);
- AaiService.getLoggedInUserID(function (response) {
- var attuid = response.data;
- var source = "VID";
- var data = {
- requestDetails: {
- requestInfo: {
- source: source,
- responseValue: taskToComplete,
- requestorId: attuid
+ var promise = new Promise(function (resolve, reject) {
+ $log.debug("MsoService:completeTask: taskId: "
+ + taskId);
+ AaiService.getLoggedInUserID(function (response) {
+ var attuid = response.data;
+ var source = "VID";
+ var data = {
+ requestDetails: {
+ requestInfo: {
+ source: source,
+ responseValue: taskToComplete,
+ requestorId: attuid
+ }
}
- }
- };
+ };
- return $http.post(
- "mso/mso_post_man_task/" + taskId, data,
- {
- timeout: PropertyService
- .getServerResponseTimeoutMsec()
+ return $http.post(
+ "mso/mso_post_man_task/" + taskId, data,
+ {
+ timeout: PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function (response) {
+ resolve(response);
})
- .catch(UtilityService.runHttpErrorHandler);
+ .catch(UtilityService.runHttpErrorHandler);
+ }, function () {
+ reject();
+ });
});
+
+ return promise;
},
showResponseContentError : function(error, showFunction) {
switch (error.type) {
@@ -251,9 +278,233 @@ var MsoService = function($http, $log, PropertyService, AaiService, UtilityServi
showFunction(FIELD.ERROR.SYSTEM_FAILURE);
}
},
- activateInstance: activateInstance
+ activateInstance: activateInstance,
+ deactivateInstance: deactivateInstance,
+
+
+ createConfigurationInstance: function(requestParams) {
+
+ const modelInfoOf = function (instance) {
+ const modelInfo = {
+ "modelType": "vnf",
+ "modelInvariantId": instance.properties['model-invariant-id'],
+ "modelVersionId": instance.properties['model-version-id'],
+ "modelName": instance.properties['model-name'],
+ "modelVersion": instance.properties['model-version'],
+ "modelCustomizationId": instance.properties['model-customization-id']
+ };
+
+ $log.debug("model info from instance", instance);
+ $log.debug("model info to model", modelInfo);
+
+ return modelInfo
+ };
+
+ var payload = {
+ "requestDetails": {
+ "modelInfo": {
+ "modelType": "configuration",
+ "modelInvariantId": requestParams.configurationModelInfo.modelInvariantId,
+ "modelVersionId": requestParams.configurationModelInfo.modelNameVersionId,
+ "modelName": requestParams.configurationModelInfo.modelName, // "Port Mirroring Configuration"
+ "modelVersion": requestParams.configurationModelInfo.modelVersion,
+ "modelCustomizationId": requestParams.configurationModelInfo.customizationUuid,
+ "modelCustomizationName": requestParams.configurationModelInfo.modelCustomizationName
+ },
+ "cloudConfiguration": {
+ // "tenantId": ????
+ "lcpCloudRegionId": requestParams.portMirroringConfigFields.lcpRegion.value
+ },
+ "requestInfo": {
+ "instanceName": requestParams.portMirroringConfigFields.instanceName.value,
+ "source": "VID",
+ "requestorId": requestParams.attuuid
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": requestParams.topServiceInstanceId,
+ "modelInfo": {
+ "modelType": "service", // relatedTopModelsInfo.modelType
+ "modelInvariantId": requestParams.relatedTopModelsInfo.modelInvariantId,
+ "modelVersionId": requestParams.relatedTopModelsInfo.modelNameVersionId,
+ "modelName": requestParams.relatedTopModelsInfo.modelName,
+ "modelVersion": requestParams.relatedTopModelsInfo.modelVersion
+ }
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": requestParams.portMirroringConfigFields.sourceInstance.properties['vnf-id'],
+ "instanceDirection": "source",
+ "modelInfo": modelInfoOf(requestParams.portMirroringConfigFields.sourceInstance)
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": requestParams.configurationByPolicy ?
+ requestParams.portMirroringConfigFields.destinationInstance.properties['pnfName']:
+ requestParams.portMirroringConfigFields.destinationInstance.properties['vnf-id'],
+ "instanceDirection": "destination",
+ "modelInfo":
+ requestParams.configurationByPolicy ?
+ {"modelType": "pnf"} :
+ modelInfoOf(requestParams.portMirroringConfigFields.destinationInstance)
+ }
+ }
+ ],
+ "requestParameters": {
+ "userParams": []
+ }
+ }
+ };
+
+ $log.debug("payload", payload);
+
+ var deferred = $q.defer();
+ $http.post([
+ 'mso','mso_create_configuration_instance',
+ requestParams.topServiceInstanceId,
+ 'configurations',''
+ ].join(COMPONENT.FORWARD_SLASH),
+ payload)
+ .success(function (response) {
+ deferred.resolve({data : response});
+ }).error(function (data, status) {
+ deferred.reject({message: data, status: status});
+ });
+ return deferred.promise;
+ },
+
+ toggleConfigurationStatus: function(requestParams) {
+
+ var requestDetails = {
+ "modelInfo": requestParams.configurationModel,
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mdt1"
+ },
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": requestParams.userId
+ },
+ "relatedInstanceList": [{
+ "relatedInstance": {
+ "instanceId": requestParams.serviceInstanceId,
+ "modelInfo": requestParams.serviceModel
+ }
+ }],
+ "requestParameters": {
+ "userParams": []
+ }
+ };
+
+ var url;
+ switch (requestParams.configStatus) {
+ case FIELD.STATUS.AAI_CREATED:
+ case FIELD.STATUS.AAI_INACTIVE:
+ url = "mso/mso_activate_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+ break;
+ case FIELD.STATUS.AAI_ACTIVE:
+ url = "mso/mso_deactivate_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+ break;
+ }
+
+ return sendPostRequest(url, requestDetails);
+ },
+
+ togglePortStatus: function(requestParams) {
+ var requestDetails = {
+ "modelInfo": requestParams.configurationModel,
+ "cloudConfiguration": {
+ "lcpCloudRegionId": "mdt1"
+ },
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": requestParams.userId
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceId": requestParams.serviceInstanceId,
+ "modelInfo": requestParams.serviceModel
+ }
+ },
+ {
+ "relatedInstance": {
+ "instanceId": requestParams.portId,
+ "instanceDirection": "source",
+ "modelInfo": {
+ "modelType": "connectionPoint"
+ }
+ }
+ }
+ ]
+ };
+
+ var url;
+ switch (requestParams.portStatus) {
+ case FIELD.STATUS.AAI_ENABLED:
+ url = "mso/mso_disable_port_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+ break;
+ case FIELD.STATUS.AAI_DISABLED:
+ url = "mso/mso_enable_port_configuration/"+requestParams.serviceInstanceId+"/configurations/"+requestParams.configurationId;
+ break;
+ }
+
+ return sendPostRequest(url, requestDetails);
+ },
+
+ buildPayloadForAssociateDissociate: function(serviceModelInfo, attuuid, instanceId, pnf) {
+ var payload = {
+ "modelInfo": {
+ "modelType": "service",
+ "modelInvariantId": serviceModelInfo.invariantUuid,
+ "modelVersionId": serviceModelInfo.uuid,
+ "modelName": serviceModelInfo.name,
+ "modelVersion": serviceModelInfo.version
+ },
+ "requestInfo": {
+ "source": "VID",
+ "requestorId": attuuid
+ },
+ "relatedInstanceList": [
+ {
+ "relatedInstance": {
+ "instanceName": pnf,
+ "modelInfo": {
+ "modelType": "pnf"
+ }
+ }
+ }],
+ "requestParameters": {
+ "aLaCarte": true
+ }
+ };
+
+ $log.debug("payload", payload);
+
+ return payload;
+ },
+ associatePnf: function(requestParams) {
+
+ var payload = this.buildPayloadForAssociateDissociate(requestParams.serviceModelInfo, requestParams.attuuid, requestParams.instanceId, requestParams.pnf);
+ return sendPostRequest([
+ COMPONENT.MSO, COMPONENT.MSO_CREATE_REALATIONSHIP,
+ requestParams.instanceId,
+ ''
+ ].join(COMPONENT.FORWARD_SLASH), payload);
+ },
+ dissociatePnf: function(requestParams) {
+
+ var payload = this.buildPayloadForAssociateDissociate(requestParams.serviceModelInfo, requestParams.attuuid, requestParams.serviceInstanceId, requestParams.pnf);
+
+ return sendPostRequest([
+ COMPONENT.MSO, COMPONENT.MSO_REMOVE_RELATIONSHIP,
+ requestParams.serviceInstanceId,
+ ''
+ ].join(COMPONENT.FORWARD_SLASH), payload);
+ }
}
};
-appDS2.factory("MsoService", [ "$http", "$log", "PropertyService",
- "AaiService", "UtilityService", "COMPONENT", "FIELD", "$q", MsoService ]);
+appDS2.factory("MsoService", MsoService );
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js
new file mode 100644
index 000000000..39a2e2d90
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/pnfService.js
@@ -0,0 +1,43 @@
+/*-
+ * ============LICENSE_START=======================================================
+ * VID
+ * ================================================================================
+ * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * ================================================================================
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ * ============LICENSE_END=========================================================
+ */
+
+"use strict";
+
+var PnfService = function ($q, AaiService) {
+ return {
+ getPnfs: function (instance) {
+ var deferred = $q.defer();
+
+ AaiService.getPNFInformationByServiceTypeAndId(
+ instance.globalCustomerId,
+ instance.serviceType,
+ instance.serviceInstanceId,
+ function (response) {
+ deferred.resolve(response);
+ },
+ function (error) {
+ deferred.reject(error);
+ });
+ return deferred.promise;
+ }
+ };
+};
+
+appDS2.factory("PnfService", ["$q", "AaiService", PnfService]);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js
index 83cc4ddac..cd0c45e7d 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/schedulerService.js
@@ -22,81 +22,24 @@
var SchedulerService = function($http, $log, PropertyService, UtilityService, COMPONENT, FIELD) {
return {
-
- getStatusSchedulerId : function(schedulerInfo,successCallbackFunction) {
- $log
- .debug("SchedulerService:getSchedulerStatusAndSchedulerId");
- var url = COMPONENT.POST_CREATE_NEW_VNF_CHANGE+COMPONENT.ASSIGN + Math.random();
-
- $http.post(url, schedulerInfo,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
-
- getTimeSotsForSchedulerId:function(schedulerID,successCallbackFunction){
- $log
- .debug("SchedulerService:getTimeSlotsForSchedulerID");
- var url = COMPONENT.GET_TIME_SLOTS+COMPONENT.FORWARD_SLASH +schedulerID+COMPONENT.ASSIGN;
-
- $http.get(url,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
-
- (UtilityService.runHttpErrorHandler);
- },
- getSubmitForapprovedTimeslots: function(ApprovedTimeSlotsObj,successCallbackFunction) {
- $log
- .debug("SchedulerService:getSchedulerStatusAndSchedulerId");
- var url = COMPONENT.SUBMIT_VNF_CHANGE_TIMESLOTS+COMPONENT.ASSIGN + Math.random();
-
- $http.post(url, ApprovedTimeSlotsObj,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- },
- getPolicyInfo:function(policyName,successCallbackFunction){
- $log
- .debug("SchedulerService:getPolicyInfo");
- var url = COMPONENT.GET_POLICY +COMPONENT.ASSIGN + Math.random();
-
- $http.post(url, policyName,
- {
- timeout : PropertyService
- .getServerResponseTimeoutMsec()
- }).then(function(response) {
- if (response.data) {
- successCallbackFunction(response);
- } else {
- successCallbackFunction([]);
- }
- })["catch"]
- (UtilityService.runHttpErrorHandler);
- }
+ cancelScheduleRequest: function(schedulerID, successCallbackFunction, errorCallbackFunction) {
+ $log.debug("SchedulerService:cancelPendingBySchedulerId");
+ var url = COMPONENT.CANCEL_SCHEDULE_REQUEST + COMPONENT.FORWARD_SLASH + schedulerID + COMPONENT.ASSIGN;
+
+ $http.delete(url,
+ {
+ timeout : PropertyService
+ .getServerResponseTimeoutMsec()
+ }).then(function(response) {
+ if (response.data) {
+ successCallbackFunction(response);
+ } else {
+ successCallbackFunction([]);
+ }
+ }).catch(function(error) {
+ errorCallbackFunction(error);
+ });
+ }
}
}
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js
new file mode 100644
index 000000000..6ae675a01
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/testEnvironmentsService.js
@@ -0,0 +1,79 @@
+(function () {
+ 'use strict';
+
+ appDS2.service('TestEnvironmentsService', ['$q', '$http', '$log', 'COMPONENT', 'UtilityService', testEnvironmentsService]);
+
+ function testEnvironmentsService($q, $http, $log, COMPONENT, UtilityService) {
+ this.loadAAIestEnvironments = function(type) {
+ var deferred = $q.defer();
+ $http.get(COMPONENT.AAI_GET_TEST_ENVIRONMENTS + type)
+ .success(function (response) {
+ if(response.httpCode == 200) {
+ deferred.resolve({operationalEnvironment: response.t.operationalEnvironment});
+ }
+ else {
+ deferred.reject({message: response.errorMessage, status: response.httpCode});
+ }
+ })
+ .error(function(data, status, headers, config) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
+ };
+
+ this.createApplicationEnv = function(request) {
+ var deferred = $q.defer();
+
+ $http.post(COMPONENT.OPERATIONAL_ENVIRONMENT_CREATE, JSON.stringify(request.requestDetails))
+ .success(function (response) {
+ deferred.resolve({data: response});
+ }).error(function (data, status) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
+ }
+
+ this.deactivateApplicationEnv = function(request) {
+ var deferred = $q.defer();
+
+ $http.post(COMPONENT.OPERATIONAL_ENVIRONMENT_DEACTIVATE + request.envId, JSON.stringify({}))
+ .success(function (response) {
+ deferred.resolve({data: response});
+ }).error(function (data, status) {
+ deferred.reject({message: data, status: status});
+ });
+
+ return deferred.promise;
+ };
+
+ this.activateApplicationEnv = function(request) {
+ var deferred = $q.defer();
+
+ $http.post(COMPONENT.OPERATIONAL_ENVIRONMENT_ACTIVATE + request.envId, JSON.stringify({
+ "relatedInstanceId": request.relatedInstanceId
+ , "relatedInstanceName": request.relatedInstanceName
+ , "workloadContext": request.workloadContext
+ , "manifest": request.manifest
+ }))
+ .success(function (response) {
+ deferred.resolve({data: response});
+ }).error(function (response, status) {
+ UtilityService.runHttpErrorHandler({data:response, status:status});
+ });
+ return deferred.promise;
+ };
+
+ this.getRequestStatus = function(requestId, successCallback) {
+ $http.get(COMPONENT.OPERATIONAL_ENVIRONMENT_STATUS + requestId)
+ .success(function(response) {
+ successCallback({data: response});
+ } )
+ .catch(UtilityService.runHttpErrorHandler);
+ };
+ }
+
+
+})();
+
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
index 4e4d12302..8577e9930 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/services/utilityService.js
@@ -67,31 +67,31 @@ var UtilityService = function($log, DataService, PARAMETER) {
var _this = this;
var convertModel = function (serviceModel) {
-
- var isNewFlow = false;
-
- for (var networkCustomizationName in serviceModel.networks) {
- var networkModel = serviceModel.networks[networkCustomizationName];
- if ( networkModel.customizationUuid != null ) {
- isNewFlow = true;
- break;
- }
- }
- if ( !isNewFlow ) {
- for (var vnfCustomizationName in serviceModel.vnfs) {
- var vnfModel = serviceModel.vnfs[vnfCustomizationName];
- if ( vnfModel.customizationUuid != null ) {
- isNewFlow = true;
- break;
- }
- }
- }
- if ( isNewFlow ) {
- return (convertNewModel (serviceModel) );
- }
- else {
- return (convertOldModel (serviceModel) );
- }
+
+ var isNewFlow = false;
+
+ for (var networkCustomizationName in serviceModel.networks) {
+ var networkModel = serviceModel.networks[networkCustomizationName];
+ if ( networkModel.customizationUuid != null ) {
+ isNewFlow = true;
+ break;
+ }
+ }
+ if ( !isNewFlow ) {
+ for (var vnfCustomizationName in serviceModel.vnfs) {
+ var vnfModel = serviceModel.vnfs[vnfCustomizationName];
+ if ( vnfModel.customizationUuid != null ) {
+ isNewFlow = true;
+ break;
+ }
+ }
+ }
+ if ( isNewFlow ) {
+ return (convertNewModel (serviceModel) );
+ }
+ else {
+ return (convertOldModel (serviceModel) );
+ }
};
var convertNewModel = function (serviceModel ) {
var completeResources = new Array();
@@ -100,6 +100,8 @@ var UtilityService = function($log, DataService, PARAMETER) {
"service": serviceModel.service,
"networks": {},
"vnfs": {},
+ "pnfs": serviceModel.pnfs,
+ "serviceProxies": serviceModel.serviceProxies,
"completeDisplayInputs": {},
"isNewFlow": true
};
@@ -164,9 +166,18 @@ var UtilityService = function($log, DataService, PARAMETER) {
}
}
-
- for (var vnfCustomizationName in serviceModel.vnfs) {
- var vnfModel = serviceModel.vnfs[vnfCustomizationName];
+
+ _.forEach(serviceModel.configurations, function(element, key) {
+ element.isConfig = true;
+ });
+ _.forEach(serviceModel.pnfs, function(element, key) {
+ element.isPnf= true;
+ element.modelCustomizationName= key;
+ });
+ var mergedVnfs = Object.assign(serviceModel.vnfs, serviceModel.configurations, serviceModel.pnfs);
+
+ for (var vnfCustomizationName in mergedVnfs) {
+ var vnfModel = mergedVnfs[vnfCustomizationName];
var vnfCustomizationUuid = vnfModel.customizationUuid;
convertedAsdcModel.vnfs[vnfModel.customizationUuid] = {
"uuid": vnfModel.uuid,
@@ -183,8 +194,13 @@ var UtilityService = function($log, DataService, PARAMETER) {
"displayInputs": {},
"properties": {},
"nfRole": "",
- "nfType": ""
- }
+ "nfType": "",
+ "sourceNodes": vnfModel.sourceNodes,
+ "collectorNodes": vnfModel.collectorNodes,
+ "isConfigurationByPolicy": vnfModel.configurationByPolicy ? vnfModel.configurationByPolicy : false,
+ "isConfig": vnfModel.isConfig ? vnfModel.isConfig : false,
+ "isPnf": vnfModel.isPnf ? vnfModel.isPnf : false
+ };
resource = {
"name": vnfModel.modelCustomizationName,
@@ -278,11 +294,11 @@ var UtilityService = function($log, DataService, PARAMETER) {
convertedAsdcModel.completeDisplayInputs = completeDisplayInputs;
// Need to collect all the model customization names (node template tag) and descriptions
DataService.setResources (completeResources);
-
- console.log ("convertedAsdcModel: "); console.log (JSON.stringify ( convertedAsdcModel, null, 4 ));
+
+ $log.debug ("convertedAsdcModel: ", convertedAsdcModel);
return (convertedAsdcModel);
};
-
+
var convertOldModel = function (serviceModel ) {
var resource = {};
@@ -290,6 +306,8 @@ var UtilityService = function($log, DataService, PARAMETER) {
"service": serviceModel.service,
"networks": {},
"vnfs": {},
+ "pnfs": serviceModel.pnfs,
+ "serviceProxies": serviceModel.serviceProxies,
"completeDisplayInputs": {},
"isNewFlow": false
};
@@ -356,9 +374,18 @@ var UtilityService = function($log, DataService, PARAMETER) {
convertedAsdcModel.networks[networkModel.uuid].displayInputs=networkModelDisplayInputs;
}
}
-
- for (var vnfCustomizationName in serviceModel.vnfs) {
- var vnfModel = serviceModel.vnfs[vnfCustomizationName];
+
+ _.forEach(serviceModel.configurations, function(element, key) {
+ element.isConfig = true;
+ });
+ _.forEach(serviceModel.pnfs, function(element, key) {
+ element.isPnf= true;
+ element.modelCustomizationName= key;
+ });
+ var mergedVnfs = Object.assign(serviceModel.vnfs, serviceModel.configurations, serviceModel.pnfs);
+
+ for (var vnfCustomizationName in mergedVnfs) {
+ var vnfModel = mergedVnfs[vnfCustomizationName];
convertedAsdcModel.vnfs[vnfModel.uuid] = {
"uuid": vnfModel.uuid,
"invariantUuid": vnfModel.invariantUuid,
@@ -371,8 +398,13 @@ var UtilityService = function($log, DataService, PARAMETER) {
"vfModules": {},
"volumeGroups": {},
"commands": {},
- "displayInputs": {}
- }
+ "displayInputs": {},
+ "sourceNodes": vnfModel.sourceNodes,
+ "collectorNodes": vnfModel.collectorNodes,
+ "isConfigurationByPolicy": vnfModel.configurationByPolicy ? vnfModel.configurationByPolicy : false,
+ "isConfig": vnfModel.isConfig ? vnfModel.isConfig : false,
+ "isPnf": vnfModel.isPnf ? vnfModel.isPnf : false
+ };
resource = {
"name": vnfModel.modelCustomizationName,
"description": vnfModel.description
@@ -441,203 +473,203 @@ var UtilityService = function($log, DataService, PARAMETER) {
convertedAsdcModel.completeDisplayInputs = completeDisplayInputs;
// Need to collect all the model customization names (node template tag) and descriptions
DataService.setResources (completeResources);
- console.log ("convertedAsdcModel: "); console.log (JSON.stringify ( convertedAsdcModel, null, 4 ));
+ $log.debug ("convertedAsdcModel: ", convertedAsdcModel);
return (convertedAsdcModel);
};
-
+
function hasContents(object) {
- if (object === undefined || object === null || object === "") {
- return false;
- }
- return true;
+ if (object === undefined || object === null || object === "") {
+ return false;
+ }
+ return true;
};
function isObjectEmpty(o) {
- var len = 0;
- if (hasContents(o)){
- var keys = Object.keys(o);
- len = keys.length;
- if ( len == 0 ) {
- return true;
- }
- else {
- return false;
- }
- }
- else {
- return true;
- }
+ var len = 0;
+ if (hasContents(o)){
+ var keys = Object.keys(o);
+ len = keys.length;
+ if ( len == 0 ) {
+ return true;
+ }
+ else {
+ return false;
+ }
+ }
+ else {
+ return true;
+ }
};
function padZero(number) {
- if (number < 10) {
- return "0" + number;
- } else {
- return "" + number;
- }
+ if (number < 10) {
+ return "0" + number;
+ } else {
+ return "" + number;
+ }
};
var httpErrorHandler = function(response, status) {
- $log.warn("UtilityService:httpErrorHandler: response:");
- $log.warn(response);
- $log.warn("UtilityService:httpErrorHandler: status:");
- $log.warn(status);
- if (angular.isFunction(_this.httpErrorHandler)) {
- _this.httpErrorHandler(response, status);
- }
+ $log.warn("UtilityService:httpErrorHandler: response:");
+ $log.warn(response);
+ $log.warn("UtilityService:httpErrorHandler: status:");
+ $log.warn(status);
+ if (angular.isFunction(_this.httpErrorHandler)) {
+ _this.httpErrorHandler(response, status);
+ }
};
var startNextAsyncOperation = function() {
- if (_this.asyncOperations.count < _this.asyncOperations.operationList.length) {
- _this.asyncOperations.operationList[_this.asyncOperations.count++]
- ();
- } else {
- if (angular.isFunction(_this.asyncOperations.callbackFunction)) {
- _this.asyncOperations.callbackFunction();
- }
- }
+ if (_this.asyncOperations.count < _this.asyncOperations.operationList.length) {
+ _this.asyncOperations.operationList[_this.asyncOperations.count++]
+ ();
+ } else {
+ if (angular.isFunction(_this.asyncOperations.callbackFunction)) {
+ _this.asyncOperations.callbackFunction();
+ }
+ }
};
return {
- setProperties : function(properties) {
- _this.properties = properties;
- },
- getProperties : function() {
- return _this.properties;
- },
- hasContents : hasContents,
- checkUndefined : function(name, value) {
- if (value === undefined) {
- throw {
- type : "undefinedObject",
- message : "undefined object: \"" + name + "\""
- };
- }
- return value;
- },
- jsonConcat : function (o1, o2) {
- for (var key in o2) {
- o1[key] = o2[key];
- }
- return o1;
- },
- getCurrentTime : function() {
- var time = new Date();
- return padZero(time.getMonth() + 1) + "/"
- + padZero(time.getDate()) + "/"
- + (time.getFullYear() - 2000) + " "
- + padZero(time.getHours()) + ":"
- + padZero(time.getMinutes()) + ":"
- + padZero(time.getSeconds())
- },
- getHttpStatusText : function(statusCode) {
- var statusMap = {
- "200" : "OK",
- "201" : "Created",
- "202" : "Accepted",
- "400" : "Bad Request",
- "401" : "Unauthorized",
- "404" : "Not Found",
- "405" : "Method Not Allowed",
- "409" : "Locked",
- "500" : "Internal Server Error",
- "503" : "Service Unavailable",
- "504" : "Gateway Timeout"
- }
+ setProperties : function(properties) {
+ _this.properties = properties;
+ },
+ getProperties : function() {
+ return _this.properties;
+ },
+ hasContents : hasContents,
+ checkUndefined : function(name, value) {
+ if (value === undefined) {
+ throw {
+ type : "undefinedObject",
+ message : "undefined object: \"" + name + "\""
+ };
+ }
+ return value;
+ },
+ jsonConcat : function (o1, o2) {
+ for (var key in o2) {
+ o1[key] = o2[key];
+ }
+ return o1;
+ },
+ getCurrentTime : function() {
+ var time = new Date();
+ return padZero(time.getMonth() + 1) + "/"
+ + padZero(time.getDate()) + "/"
+ + (time.getFullYear() - 2000) + " "
+ + padZero(time.getHours()) + ":"
+ + padZero(time.getMinutes()) + ":"
+ + padZero(time.getSeconds())
+ },
+ getHttpStatusText : function(statusCode) {
+ var statusMap = {
+ "200" : "OK",
+ "201" : "Created",
+ "202" : "Accepted",
+ "400" : "Bad Request",
+ "401" : "Unauthorized",
+ "404" : "Not Found",
+ "405" : "Method Not Allowed",
+ "409" : "Locked",
+ "500" : "Internal Server Error",
+ "503" : "Service Unavailable",
+ "504" : "Gateway Timeout"
+ }
- if (status === undefined) {
- return "Undefined";
- }
+ if (status === undefined) {
+ return "Undefined";
+ }
- var statusText = statusMap[statusCode];
- if (statusText === undefined) {
- statusText = "Unknown";
- }
+ var statusText = statusMap[statusCode];
+ if (statusText === undefined) {
+ statusText = "Unknown";
+ }
- return statusText + " (" + statusCode + ")";
- },
- getHttpErrorMessage : function(response) {
- var data = response.data;
- if (response.status === 500 && hasContents(data.exception)) {
- var summary = "exception: " + data.exception;
- if (hasContents(data.message)) {
- summary += " message: " + data.message;
- }
- return summary;
- }
- if (response.status === 0 && response.statusText === "") {
- /*
- * This logic is somewhat "fuzzy". Potential (brainstorming)
- * enhancements if users find the message unreliable include:
- *
- * A) SERVER TIMEOUT: perhaps a newer version of Angular can
- * reliably determine timeouts.
- *
- * B) SERVER TIMEOUT: recording start / end times and using that
- * to determine if timeout occured
- *
- * C) SESSION TIMEOUT "Potentially" examine cookies, although
- * that may not be feasible if cookies are set to "httponly".
- */
- if (data === null) {
- //return "possible server timeout";
- return "VID has timed out waiting for a response. To see status, close this popup and the screen will be refreshed automatically";
- }
- if (data === "") {
- return "Possible reasons include a session timeout or a server issue. "
- + "A session timeout might be resolved by refreshing the screen and re-logging in";
- }
- }
- var summary = "";
- if (response.status !== undefined && response.status > 0) {
- summary = "status: " + response.status;
- }
- if (hasContents(response.statusText)) {
- if (summary !== "") {
- summary += " ";
- }
- summary += "message: " + response.statusText;
- }
- return summary;
- },
- setHttpErrorHandler : function(httpErrorHandler) {
- _this.httpErrorHandler = httpErrorHandler;
- },
- runHttpErrorHandler : function(response, status) {
- httpErrorHandler(response, status);
- },
- startAsyncOperations : function(operationList, callbackFunction) {
- for (var i = 0; i < operationList.length; i++) {
- if (!angular.isFunction(operationList[i])) {
- throw "UtilityService:startAsyncOperations: invalid function: index: "
- + i;
- }
- }
- _this.asyncOperations = {
- operationList : operationList,
- callbackFunction : callbackFunction,
- count : 0
- };
- startNextAsyncOperation();
- },
- startNextAsyncOperation : startNextAsyncOperation,
- stopAsyncOperations : function() {
- _this.asyncOperations.count = _this.asyncOperations.operationList.length;
- },
- isObjectEmpty : isObjectEmpty,
- convertModel : convertModel,
- convertNewModel : convertNewModel,
- convertOldModel : convertOldModel,
- arrayContains : function (a, obj) {
- var i = a.length;
- if ( i > 0 ) {
- while (i--) {
- if (a[i] === obj) {
- return true;
- }
- }
- }
- return false;
- }
- }
+ return statusText + " (" + statusCode + ")";
+ },
+ getHttpErrorMessage : function(response) {
+ var data = response.data;
+ if ((response.status >= 400 && response.status < 600) && hasContents(data.exception)) {
+ var summary = "exception: " + data.exception;
+ if (hasContents(data.message)) {
+ summary += " message: " + data.message;
+ }
+ return summary;
+ }
+ if (response.status === 0 && response.statusText === "") {
+ /*
+ * This logic is somewhat "fuzzy". Potential (brainstorming)
+ * enhancements if users find the message unreliable include:
+ *
+ * A) SERVER TIMEOUT: perhaps a newer version of Angular can
+ * reliably determine timeouts.
+ *
+ * B) SERVER TIMEOUT: recording start / end times and using that
+ * to determine if timeout occured
+ *
+ * C) SESSION TIMEOUT "Potentially" examine cookies, although
+ * that may not be feasible if cookies are set to "httponly".
+ */
+ if (data === null) {
+ //return "possible server timeout";
+ return "VID has timed out waiting for a response. To see status, close this popup and the screen will be refreshed automatically";
+ }
+ if (data === "") {
+ return "Possible reasons include a session timeout or a server issue. "
+ + "A session timeout might be resolved by refreshing the screen and re-logging in";
+ }
+ }
+ var summary = "";
+ if (response.status !== undefined && response.status > 0) {
+ summary = "status: " + response.status;
+ }
+ if (hasContents(response.statusText)) {
+ if (summary !== "") {
+ summary += " ";
+ }
+ summary += "message: " + response.statusText;
+ }
+ return summary;
+ },
+ setHttpErrorHandler : function(httpErrorHandler) {
+ _this.httpErrorHandler = httpErrorHandler;
+ },
+ runHttpErrorHandler : function(response, status) {
+ httpErrorHandler(response, status);
+ },
+ startAsyncOperations : function(operationList, callbackFunction) {
+ for (var i = 0; i < operationList.length; i++) {
+ if (!angular.isFunction(operationList[i])) {
+ throw "UtilityService:startAsyncOperations: invalid function: index: "
+ + i;
+ }
+ }
+ _this.asyncOperations = {
+ operationList : operationList,
+ callbackFunction : callbackFunction,
+ count : 0
+ };
+ startNextAsyncOperation();
+ },
+ startNextAsyncOperation : startNextAsyncOperation,
+ stopAsyncOperations : function() {
+ _this.asyncOperations.count = _this.asyncOperations.operationList.length;
+ },
+ isObjectEmpty : isObjectEmpty,
+ convertModel : convertModel,
+ convertNewModel : convertNewModel,
+ convertOldModel : convertOldModel,
+ arrayContains : function (a, obj) {
+ var i = a.length;
+ if ( i > 0 ) {
+ while (i--) {
+ if (a[i] === obj) {
+ return true;
+ }
+ }
+ }
+ return false;
+ }
+ }
}
//app.factory("UtilityService", UtilityService);
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm
index c5c5ccaa9..233bab1c8 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubs.htm
@@ -39,7 +39,8 @@
<br>
Please search by the Subscriber name or enter Service Instance Id or Service Instance Name below:&nbsp;<br><br>
- <table>
+ <table ng-init="loadOwningEntity()">
+
<tr>
<td style="width:30%">
<div class="fn-ebz-container">
@@ -51,7 +52,7 @@
<!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
<!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
<!--</select>-->
- <select ng-model="selectedCustomer"
+ <select ng-model="selectedCustomer" id="selectSubscriber"
ng-options="item.globalCustomerId as item.subscriberName for item in customerList | orderBy:'subscriberName'">
<option value="">Select a subscriber</option>
</select>
@@ -60,8 +61,9 @@
class="glyphicon glyphicon-refresh"></span></a>
</div>
</td>
-
</tr>
+
+
<tr>
<td style="width:30%">
<div class="fn-ebz-container">
@@ -72,8 +74,8 @@
</div>
</td>
<td style="width:60%">
- <div class="fn-ebz-container">
- <input type="text" style="width: 350px;" name="selectedServiceInstance"
+ <div class="fn-ebz-container" style="width: 100%;">
+ <input type="text" name="selectedServiceInstance"
ng-model="selectedServiceInstance"
data-tests-id="searchForExistingInstancesText"
restrict-input="{type : selectedserviceinstancetype}"/>
@@ -81,12 +83,51 @@
</td>
</tr>
+
+ <tr>
+ <td style="width:30%">
+ <div class="fn-ebz-container">
+ <label class="fn-ebz-text-label">Owning entity Name:</label>
+ </div>
+ </td>
+ <td style="width:30%" nowrap>
+ <div class="fn-ebz-container" style="width: 100%;">
+ <!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
+ <!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
+ <!--</select>-->
+ <multiselect id="selectOwningEntity" ng-model="selectedEntity"
+ options="owningEntities"
+ display-prop="name" id-prop="id">
+ </multiselect>
+ </div>
+ </td>
+ </tr>
+
+ <tr>
+ <td style="width:30%">
+ <div class="fn-ebz-container">
+ <label class="fn-ebz-text-label">Project Name:</label>
+ </div>
+ </td>
+ <td style="width:30%" nowrap>
+ <div class="fn-ebz-container" style="width: 100%;">
+ <!--<select name="selectedCustomer" ng-model="selectedCustomer">-->
+ <!--<option ng-repeat="item in customerList" value="{{item.globalCustomerId}}" ng-disabled="getPermitted(item)">{{item.subscriberName}}</option>-->
+ <!--</select>-->
+ <multiselect id="selectProject" ng-model="selectedProject"
+ options="projects"
+ display-prop="name" id-prop="id">
+ </multiselect>
+ </div>
+ </td>
+ </tr>
+
<tr>
<td>
<td style="width:30%">
<div>
<button type="submit" class="btn btn-primary" size="small"
- ng-click="getSubscriberDet(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance);">
+ ng-click="getServiceInstancesSearchResults(selectedCustomer,selectedserviceinstancetype,selectedServiceInstance, selectedProject, selectedEntity);">
Submit
</button>
</a>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm
index 16357dde9..6198cb478 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiGetSubscriberList.htm
@@ -18,52 +18,66 @@
============LICENSE_END=========================================================
-->
-<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css" />
-<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiGetSubs.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/aaiSubDetails.css"/>
<script src="app/vid/scripts/controller/aaiSubscriberController.js"></script>
<div ng-controller="aaiSubscriberController" ng-cloak>
- <div>
- <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
- <img src="app/vid/images/spinner.gif"></img>
- <label>Status:</label><span class="status">{{status}}</span>
- </div>
-
- <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
-
- <h2 class="heading2"><center>Create New Service Instance</center></h2>
-
- <table>
- <tr>
- <td >
- <div class="fn-ebz-container">
- <label class="fn-ebz-text-label">Subscriber Name:</label>
- </div>
- </td>
- <td style="width:80%" nowrap>
- <div class="fn-ebz-container" ng-init="autoGetSubs();">
- <select ng-model="selectedCustomer" data-tests-id="subscriberName">
- <option value="">Select Subscriber Name</option>
- <option ng-repeat="item in customerList | orderBy:'subscriberName'" ng-value="item.globalCustomerId" ng-disabled="!item.isPermitted" class="subscriberNameOption">{{item.subscriberName}}</option>
- </select>
- &nbsp;&nbsp;<a class="btn btn-primary" ng-click="refreshSubs();" ><span class="glyphicon glyphicon-refresh"></span></a>
- </div>
- </td>
-
- </tr>
- <tr>
- <td >
- </td>
- <td style="width:80%">
- <div >
- <button type="submit" class="btn btn-primary" size="small" ng-click="getServiceTypes(selectedCustomer);">Submit</button></a>
- &nbsp;&nbsp;<button type="submit" class="btn btn-primary" size="small" ng-click="cancelCreateSI()">Cancel</button></a>
- </div>
- </td>
- </tr>
- </table>
-
-
- </div>
+ <div>
+ <div class="statusLine" ng-class="{true:'aaiVisible', false:'aaiHidden'}[isSpinnerVisible]">
+ <img src="app/vid/images/spinner.gif"></img>
+ <label>Status:</label><span class="status">{{status}}</span>
+ </div>
+
+ <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}
+ <pre>{{errorDetails | json}}</pre>
+ </font></div>
+
+ <h2 class="heading2">
+ <center>Create New Service Instance</center>
+ </h2>
+
+ <table>
+ <tr>
+ <td>
+ <div class="fn-ebz-container">
+ <label class="fn-ebz-text-label">Subscriber Name:</label>
+ </div>
+ </td>
+ <td style="width:80%" nowrap>
+ <div class="fn-ebz-container" ng-init="autoGetSubs();">
+ <select ng-model="selectedCustomer" data-tests-id="subscriberName">
+ <option value="">Select Subscriber Name</option>
+ <option ng-repeat="item in customerList | orderBy:'subscriberName'"
+ ng-value="item.globalCustomerId" ng-disabled="!item.isPermitted"
+ class="subscriberNameOption">{{item.subscriberName}}
+ </option>
+ </select>
+ &nbsp;&nbsp;<a class="btn btn-primary" ng-click="refreshSubs();"><span
+ class="glyphicon glyphicon-refresh"></span></a>
+ </div>
+ </td>
+
+ </tr>
+ <tr>
+ <td>
+ </td>
+ <td style="width:80%">
+ <div>
+ <button type="submit" class="btn btn-primary" size="small"
+ ng-click="getServiceTypes(selectedCustomer);">Submit
+ </button>
+ </a>
+ &nbsp;&nbsp;<button type="submit" class="btn btn-primary" size="small"
+ ng-click="cancelCreateSI()">Cancel
+ </button>
+ </a>
+ </div>
+ </td>
+ </tr>
+ </table>
+
+
+ </div>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm
index 06a53c3eb..dc9f0a425 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiServiceTypes.htm
@@ -31,7 +31,7 @@
<div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
<h2 class="heading2"><center>Create New Service Instance</center></h2>
- <table>
+ <table class="create-instance-service ">
<tr>
<td >
@@ -69,7 +69,7 @@
</td>
<td style="width:80%">
<div >
- <button type="submit" class="btn btn-primary" size="small" ng-click="getAaiServiceModels(selectedServicetype,createSubscriberName);">Submit</button></a>
+ <button type="submit" class="btn btn-primary" size="small" ng-click="getAaiServiceModels(selectedServicetype,createSubscriberName);" ng-disabled="!selectedServicetype" ng-class="{'button--inactive': !selectedServicetype}">Submit</button></a>
&nbsp;&nbsp;<button type="submit" class="btn btn-primary" size="small" ng-click="cancelCreateSIType()">Cancel</button></a>
</div>
</td>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm
index 3471fcb98..686e33b05 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubDetails.htm
@@ -27,13 +27,13 @@
<label>Status:</label><span class="status">{{status}}</span>
</div>
- <div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
+ <div data-tests-id="subDetailsErrMsg" ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
- <h1 class="heading1"><center>Subscriber Details for {{selectedSubscriber}} ({{selectedSubscriberName}})</center></h1>
+ <h1 class="heading1"><center>Subscriber Details for {{selectedSubscriberId}} ({{selectedSubscriberName}})</center></h1>
<br>
<div class="fn-ebz-container">
Filter:
- <input class="fn-ebz-text" type="text" ng-model="searchString" size="20" style="width: 250px;">
+ <input class="fn-ebz-text" type="text" ng-model="searchString" size="20" style="width: 250px;" data-tests-id="filter-subscriber-details">
</div>
<div ng-init="getSubDetails();">
@@ -54,13 +54,13 @@
<tr>
<td att-table-body>
<div>
- <a alt="View/Edit" ng-click="getAsdcModel(disData);" data-tests-id="{{'view/edit-test-data-id-' + disData['serviceInstanceId']}}" ng-bind="disData.isPermitted ? 'View/Edit' : 'View'"></a>
+ <a alt="View/Edit" ng-click="onViewEditClick(disData);" data-tests-id="{{'view/edit-test-data-id-' + disData['serviceInstanceId']}}" ng-bind="disData.isPermitted ? 'View/Edit' : 'View'"></a>
</div>
</td>
<td att-table-body ng-bind="disData['globalCustomerId']"></td>
- <td att-table-body ng-bind="disData['subscriberName']"></td>
+ <td att-table-body ng-bind="disData['subscriberName']" data-tests-id="{{'subscriber-name-test-data-id-' + $index}}"></td>
<td att-table-body ng-bind="disData['serviceType']"></td>
- <td att-table-body ng-bind="disData['serviceInstanceName']"></td>
+ <td att-table-body ng-bind="disData['serviceInstanceName']" data-tests-id="{{'service-name-test-data-id-' + $index}}"></td>
<td att-table-body data-tests-id="{{'instance-id-for-name-' + disData['serviceInstanceName']}}" ng-bind="disData['serviceInstanceId']"></td>
</tr>
</tbody>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm
index 40bd1488c..31621cfe5 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/aaiSubViewEdit.htm
@@ -23,7 +23,7 @@
<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
ng-cloak>
<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
<div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
new file mode 100644
index 000000000..6983477e1
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/addNetworkNode.htm
@@ -0,0 +1,62 @@
+<!--
+============LICENSE_START=======================================================
+VID
+================================================================================
+Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<link rel="stylesheet" type="text/css" href="app/vid/styles/networkNode.css"/>
+
+<div class="network-wrapper-config">
+ <div class="head">
+ <div class="title">Config {{modelName}}</div>
+ <div class="btn-wrapper">
+ <button class="cancel-btn grey" data-tests-id="cancelButton" data-ng-click="cancel()">Cancel</button>
+ <button class="next-btn blue" data-tests-id="nextButton" data-ng-disabled="networkNodeForm.$invalid" data-ng-click="next()">Next</button>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <form name="networkNodeForm" class="form-wrapper">
+ <div class="instance-field {{field.id}}" ng-repeat="(key, field) in nodeTemplateFields">
+ <input id="{{field.id}}" data-tests-id="suppressRollbackInput" ng-if="key === 'suppressRollback'" type="checkbox" ng-model="field.value"/>
+ <label for="{{field.id}}"class="title" ng-if="key !== 'lineOfBusiness' && key !== 'platform'">
+ {{field.name}}
+ </label>
+ <div class="" ng-if="key === 'instanceName'">
+ <input data-tests-id="instanceNameInput" name="{{field.id}}" id="{{field.id}}" type="text" required ng-model="field.value" ng-pattern="regexInstanceName">
+ <span class="error" data-ng-show="!networkNodeForm.instanceName.$error.required && networkNodeForm.instanceName.$dirty && networkNodeForm.instanceName.$invalid">{{errorMsg}}</span>
+ </div>
+ <select id="{{field.id}}" data-tests-id="regionDropDown" ng-if="key === 'lcpRegion'" required ng-model="field.value"
+ placeholder="Choose {{field.name}}"
+ data-ng-change="setTenant(field)">
+ <option value="" selected>LCP region</option>
+ <option data-ng-disabled="!option.isPermitted" ng-repeat="option in field.optionList"
+ value="{{option.id}}" data-tests-id="{{'region-' + option.id}}">{{option.id}}</option>
+ </select>
+ <select id="{{field.id}}" data-tests-id="tenantDropDown" ng-if="key === 'tenant'" required ng-model="field.value"
+ data-ng-options="option.tenantName for option in field.optionList" placeholder="Choose {{field.name}}"
+ data-ng-disabled="!field.optionList || !field.optionList.length">
+ <option value="" selected>Tenant name</option>
+ </select>
+ </div>
+ </form>
+ </div>
+ <div class="sidebar-right">
+ <service-metadata title-txt="info" service-metadata-fields="serviceMetadataFields"></service-metadata>
+ </div>
+ </div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html
index 0f42ec874..94a1790db 100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/change-management.html
@@ -13,63 +13,95 @@
<input type="search" id="change-management-search" class="search-changes" ng-change="vm.searchChanges()" ng-model-options="{debounce: 300}" ng-model="vm.searchChangesTerm" placeholder="Type to search">
</div>
+ <span class="refresh-cm">
+ Last updated at:
+ <span class="last-time-updated">{{ vm.lastTimeUpdated }}</span>
+ <i class="icon-sync" data-tests-id="refresh-cm" ng-click="vm.init()"></i>
+ </span>
<div class="jobs-table">
<div class="row">
<div class="col-md-12">
<uib-tabset active="activeJustified" justified="true">
<uib-tab index="0" heading="Active" id="active-tab">
- <table class="table table-bordered" id="active-table">
- <thead class="thead-default">
- <tr>
- <th class="col-md-5">VNF Name</th>
- <th class="col-md-2">Type</th>
- <th class="col-md-2">Flow</th>
- <th class="col-md-2">Start time</th>
- <th>Status</th>
- <th></th>
- </tr>
- </thead>
- <tbody>
+ <div class="table-wrapper">
+ <table class="table table-bordered" data-tests-id="active-table-cm" id="active-table">
+ <thead class="thead-default" ng-click="collapseInProgress=!collapseInProgress">
<tr class="table-headline-row">
- <th>
+ <th >
+ <span ng-class="{'collapse-icon':!collapseInProgress,'expand-icon':collapseInProgress }"></span>
<span id="in-progress-table-head">IN PROGRESS</span>
</th>
<th></th>
<th></th>
<th></th>
<th></th>
- <th></th>
</tr>
- <tr ng-repeat="changeManagement in vm.changeManagements | changeManagementsByStatuses:{statuses: ['FAILED', 'INPROGRESS', 'PENDING']}">
+ <tr ng-show="!collapseInProgress">
+ <th class="col-md-5">VNF Name</th>
+ <th class="col-md-2">Type</th>
+ <th class="col-md-2">Flow</th>
+ <th class="col-md-2">Start time</th>
+ <th>Status</th>
+ </tr>
+ </thead>
+ <tbody ng-show="!collapseInProgress">
+
+ <tr data-tests-id="active-table-cm-row" ng-repeat="changeManagement in vm.changeManagements | changeManagementsByStatuses:{statuses: ['FAILED', 'IN_PROGRESS', 'PENDING']}">
<th scope="row">{{changeManagement.instanceReferences.vnfInstanceName || 'No-Instance-Name'}}</th>
<td>{{changeManagement.requestScope}}</td>
<td>{{changeManagement.requestType}}</td>
<td>{{changeManagement.startTime}}</td>
<td class="centered" ng-if="changeManagement.requestStatus.requestState == 'FAILED'"><span class="icon-x" ng-click="vm.openFailedModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
- <td class="centered" ng-if="changeManagement.requestStatus.requestState == 'INPROGRESS'"><span class="icon-process" ng-click="vm.openInProgressModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
+ <td class="centered" ng-if="changeManagement.requestStatus.requestState == 'IN_PROGRESS'"><span class="icon-process" ng-click="vm.openInProgressModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
<td class="centered" ng-if="changeManagement.requestStatus.requestState == 'PENDING'"><span class="icon-alert" ng-click="vm.openAlertModal({details: changeManagement.requestStatus.statusMessage, job: changeManagement})"></span></td>
- <td class="centered"><span class="icon-view"></span></td>
</tr>
- <tr class="table-headline-row">
- <th>
- <span id="pending-table-head">PENDING</span>
- </th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- <th></th>
- </tr>
- <tr ng-repeat="changeManagement in vm.pendingChangeManagements">
- <th scope="row">{{changeManagement.vnfName}}</th>
- <td>{{changeManagement.scheduleRequest.scheduleName}}</td>
- <td>{{changeManagement.workflow}}</td>
- <td>{{changeManagement.startTime}}</td>
- <td class="centered"><span class="icon-pending" ng-click="vm.openPendingModal({details: 'change management is pending in scheduler and waiting to be deployed'})"></span></td>
- <td class="centered"><span class="icon-view"></span></td>
+ </tbody>
+ </table>
+ </div>
+ <div class="table-wrapper">
+ <table class="table table-bordered" data-tests-id="pending-table-cm" id="pending-table">
+ <thead ng-click="collapsePending=!collapsePending">
+ <tr class="table-headline-row">
+ <th class="col-md-6">
+ <span ng-class="{'collapse-icon':!collapsePending,'expand-icon':collapsePending }"></span>
+ <span id="pending-table-head">PENDING</span>
+ </th>
+
+ <th></th>
+ <th></th>
+ <th></th>
+ <th></th>
+ <th></th>
+ <th></th>
+ <th></th>
+ </tr>
+ <tr class="thead-default" ng-show="!collapsePending">
+ <th class="col-md-2">Schedule ID</th>
+ <th class="col-md-2">CM ticket</th>
+ <th class="col-md-1">VNF name</th>
+ <th class="col-md-1">VNF status</th>
+ <th class="col-md-2">Workflow</th>
+ <th class="col-md-2">Start time</th>
+ <th class="col-md-2">Schedule status</th>
+ <th class="col-md-1">Status</th>
+ </tr>
+ </thead>
+ <tbody ng-show="!collapsePending">
+
+ <tr data-tests-id="pending-table-cm-row" ng-repeat="changeManagement in vm.pendingChangeManagements">
+ <th scope="row">{{changeManagement.scheduleRequest.scheduleId}}</th>
+ <td>{{changeManagement.aotsChangeId}}</td>
+ <td>{{changeManagement.vnfName}}</td>
+ <td>{{changeManagement.status}}</td>
+ <td>{{changeManagement.scheduleRequest.domainData[1].value}}</td>
+ <td>{{changeManagement.scheduleRequest.createDateTime }}</td><!--| date:"MM/dd/yyyy HH:mm:ss"-->
+ <td>{{changeManagement.scheduleRequest.status}}</td>
+ <td class="centered"><span class="cancel-action" ng-class="{'icon-pending':changeManagement.scheduleRequest.status!=='Deleted', 'icon-deleted': changeManagement.scheduleRequest.status=='Deleted'}"
+ ng-click="vm.openPendingModal($event, changeManagement)"></span></td>
</tr>
</tbody>
</table>
+ </div>
</uib-tab>
<uib-tab index="1" heading="Finished" id="finished-tab">
<table class="table table-bordered" id="finished-table">
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm
index 0f694612c..da249c2cc 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/createInstanceServiceModels.htm
@@ -19,6 +19,8 @@
-->
<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceModels.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/buttons.css" />
+
<div popup-window class="popupContents" ngx-show="{{popup.isTablePopUpVisible}}" ng-cloak>
<div ng-include="'app/vid/scripts/view-models/previousVersion.htm'"/>
</div>
@@ -36,7 +38,7 @@
<br><br>
- <table>
+ <table class="create-instance-service ">
<tr>
<td >
@@ -77,7 +79,7 @@
<!-- <h1 class="heading1" style="margin-top:20px;">Browse SDC Service Models</h1> -->
<div style="margin-top:30px" ng-init="getAaiServiceModelsList();">
- <table att-table table-data="services" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
+ <table data-tests-id="services-list" att-table table-data="services" view-per-page="viewPerPage" current-page="currentPage" search-category="searchCategory" search-string="searchString" total-page="totalPage">
<thead att-table-row type="header">
<tr>
<th att-table-header key="action">Action</th>
@@ -100,9 +102,10 @@
<td att-table-body ng-bind="service['extra-properties']['extra-property'][4]['property-value']"></td>
<td att-table-body ng-bind="service['extra-properties']['extra-property'][6]['property-value']"></td>
<td att-table-body ng-show="service['extra-properties']['extra-property'][6]['property-value'] > '1.0' ">
- <button type=button ng-click="loadPreviousVersionData(service['extra-properties']['extra-property'][6]['property-value'],service['extra-properties']['extra-property'][4]['property-value'])" att-button btn-type="primary" size="small">
+ <div class="clickable-text previous-versions-button"
+ ng-click="loadPreviousVersionData(service['extra-properties']['extra-property'][6]['property-value'],service['extra-properties']['extra-property'][4]['property-value'])">
Previous Versions
- </button>
+ </div>
</td>
<td att-table-body ng-show="service['extra-properties']['extra-property'][6]['property-value'] <= '1.0' ">&nbsp;</td>
</tr>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm
index 4449285d2..ca13ca2b7 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/creationDialog.htm
@@ -4,7 +4,7 @@
<div class="titleLine">
<img src="app/vid/images/spinner.gif"
ngx-visible="{{isSpinnerVisible}}"></img>
- <h3>Create {{componentName}} -- {{createType}}</h3>
+ <h3 data-tests-id="create-modal-title">Create {{componentName}} -- {{createType}}</h3>
</div>
<div class="error" ng-show="isErrorVisible">
@@ -33,7 +33,7 @@
<div class="buttonRow">
<button data-tests-id="confirmButton" ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
ng-click="confirm();">Confirm</button>
- <button type="button" ng-click="cancel();" att-button
+ <button type="button" data-tests-id="cancelButton" ng-click="cancel();" att-button
btn-type="primary" size="small">Cancel</button>
</div>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
index b4b93166b..ccd54a612 100755..100644
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deletionDialog.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/deleteResumeDialog.htm
@@ -1,70 +1,70 @@
-<!--
- ============LICENSE_START=======================================================
- VID
- ================================================================================
- Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
- ================================================================================
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
- ============LICENSE_END=========================================================
- -->
-
-<div ng-controller="deletionDialogController">
-
- <div ng-show="isDialogVisible">
- <div class="titleLine">
- <img src="app/vid/images/spinner.gif"
- ngx-visible="{{isSpinnerVisible}}"></img>
- <h3>Delete {{componentName}}</h3>
- </div>
-
- <div class="error" ng-show="isErrorVisible">
- <img src="app/vid/images/error.png"></img>{{error}}
- </div>
-
- <parameter-block control="summaryControl"></parameter-block>
-
- <div ngx-visible="{{isDataVisible}}">
-
- <h4>
- User Provided Data (<img class="requiredIndicator"
- src="app/vid/images/asterisk.png" height='10' width='10'></img> indicates required field)
- </h4>
- <parameter-block control="userProvidedControl"
- callback="userParameterChanged(id);" editable></parameter-block>
-
- <div class="prompt">
- <p>
- Enter Data and <span>Confirm</span> to<br />Delete <span>{{componentName}}</span>
- </p>
- <p>
- <span>Cancel</span> to Return to Previous Page.<br />Data entered
- will be lost
- </p>
- </div>
- </div>
-
- <div class="buttonRow">
- <!-- <button type="button" ng-click="confirm();" att-button
- btn-type="primary" size="small" class="confirm">Confirm</button>
- <button type="button" ng-click="cancel();" att-button
- btn-type="primary" size="small">Cancel</button> --->
- <button ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
- ng-click="confirm();">Confirm</button>
- <button type="button" ng-click="cancel();" att-button
- btn-type="primary" size="small">Cancel</button>
- </div>
- </div>
-
- <div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
-
-</div>
+<!--
+ ============LICENSE_START=======================================================
+ VID
+ ================================================================================
+ Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ ================================================================================
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ ============LICENSE_END=========================================================
+ -->
+
+<div ng-controller="deleteResumeDialogController">
+
+ <div ng-show="isDialogVisible">
+ <div class="titleLine">
+ <img src="app/vid/images/spinner.gif"
+ ngx-visible="{{isSpinnerVisible}}"></img>
+ <h3>{{dialogMethod}} {{componentName}}</h3>
+ </div>
+
+ <div class="error" ng-show="isErrorVisible">
+ <img src="app/vid/images/error.png"></img>{{error}}
+ </div>
+
+ <parameter-block control="summaryControl"></parameter-block>
+
+ <div ngx-visible="{{isDataVisible}}">
+
+ <h4>
+ User Provided Data (<img class="requiredIndicator"
+ src="app/vid/images/asterisk.png" height='10' width='10'></img> indicates required field)
+ </h4>
+ <parameter-block control="userProvidedControl"
+ callback="userParameterChanged(id);" editable></parameter-block>
+
+ <div class="prompt">
+ <p>
+ Enter Data and <span>Confirm</span> to<br />{{dialogMethod}} <span>{{componentName}}</span>
+ </p>
+ <p>
+ <span>Cancel</span> to Return to Previous Page.<br />Data entered
+ will be lost
+ </p>
+ </div>
+ </div>
+
+ <div class="buttonRow">
+ <!-- <button type="button" ng-click="confirm();" att-button
+ btn-type="primary" size="small" class="confirm">Confirm</button>
+ <button type="button" ng-click="cancel();" att-button
+ btn-type="primary" size="small">Cancel</button> --->
+ <button data-tests-id="confirmResumeDeleteButton" ngx-enabled="{{isConfirmEnabled}}" att-button size="small"
+ ng-click="confirm();">Confirm</button>
+ <button type="button" ng-click="cancel();" att-button
+ btn-type="primary" size="small">Cancel</button>
+ </div>
+ </div>
+
+ <div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
+
+</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
index 71efef1dd..0740c07ef 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/instantiate.htm
@@ -23,7 +23,7 @@
<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
ng-cloak>
<div ng-include="'app/vid/scripts/view-models/creationDialog.htm'"></div>
- <div ng-include="'app/vid/scripts/view-models/deletionDialog.htm'"></div>
+ <div ng-include="'app/vid/scripts/view-models/deleteResumeDialog.htm'"></div>
<div ng-include="'app/vid/scripts/view-models/detailsDialog.htm'"></div>
<div ng-include="'app/vid/scripts/view-models/statusDialog.htm'"></div>
</div>
@@ -35,7 +35,7 @@
<div ng-if="errorMsg != null"><font color='red'>{{errorMsg}}<pre>{{errorDetails | json}}</pre></font></div>
- <h1 class="heading1" style="margin-top: 20px;">{{isPermitted == "true" ? "View/Edit" : "View"}} Service Instance</h1>
+ <h1 class="heading1" style="margin-top: 20px;">{{isPermitted ? "View/Edit" : "View"}} Service Instance</h1>
<a class="btn btn-primary btn-xs pull-right" ng-click="reloadRoute();" ><span class="glyphicon glyphicon-refresh"></span></a>
<br>
@@ -47,7 +47,7 @@
{{service.instance.subscriberName}}</th>
<th style="text-align: center" width="34%">SERVICE TYPE:
{{service.instance.serviceType}}</th>
- <th style="text-align: center" width="33%">SERVICE INSTANCE
+ <th data-tests-id="service-instanceId-th-id" style="text-align: center" width="33%">SERVICE INSTANCE
ID: {{service.instance.serviceInstanceId}}</th>
<tr>
<tr>
@@ -64,16 +64,16 @@
<ol ui-tree-nodes="" ng-model="service" >
<li ng-repeat="aService in [service]" ui-tree-node>
<div ui-tree-handle class="tree-node tree-node-content">
- <a class="btn btn-success btn-xs" ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)" data-nodrag ng-click="this.toggle()">
+ <a class="btn btn-success btn-xs" ng-if="(aService.instance.vnfs && aService.instance.vnfs.length > 0) ||(aService.instance.pnfs && aService.instance.pnfs.length > 0) || (aService.instance.networks && aService.instance.networks.length > 0)" data-nodrag ng-click="this.toggle()">
<span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
</a>
- SERVICE INSTANCE: {{aService.instance.name}}
- <a ng-if="((isMacro()) || (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks))) && isPermitted" data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteService(aService.instance);">
+ SERVICE INSTANCE: {{aService.instance.name}} | ORCH STATUS: {{serviceOrchestrationStatus}}
+ <a ng-if="((isMacro()) || (isObjectEmpty(aService.instance.vnfs) && isObjectEmpty(aService.instance.networks) && isObjectEmpty(aService.instance.pnfs))) && isPermitted" data-tests-id="deleteServiceButton" class="pull-right btn btn-danger btn-xs" data-nodrag ng-click="deleteService(aService.instance);">
<span class="glyphicon glyphicon-remove"></span>
</a>
- <div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && !aService.convertedModel.isNewFlow && isPermitted">
+ <div class="pull-right btn-group" ng-if="(aService.convertedModel.vnfs||aService.convertedModel.vnfs) &&(!isObjectEmpty(aService.convertedModel.pnfs)||!isObjectEmpty(aService.convertedModel.pnfs)) && !aService.convertedModel.isNewFlow && isPermitted">
<button type="button" data-tests-id="addVNFButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add VNF<span class="caret"></span>
+ Add node instance<span class="caret"></span>
</button>
<ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs">
<a role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs" data-tests-id="addVNFOption-{{vnf.modelCustomizationName}}" ng-click="addVnfInstance(vnf, aService.instance.vnfs)">{{vnf.modelCustomizationName}}</a>
@@ -82,7 +82,7 @@
</div>
<div class="pull-right btn-group" ng-if="aService.convertedModel.vnfs && !isObjectEmpty(aService.convertedModel.vnfs) && aService.convertedModel.isNewFlow && isPermitted">
<button type="button" data-tests-id="addVNFButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- Add VNF<span class="caret"></span>
+ Add node instance<span class="caret"></span>
</button>
<ul class="dropdown-menu" ng-model="aService.convertedModel.vnfs" data-tests-id="addVnfsDropdown">
<li role="menuitem" ng-repeat="(vnfUuid, vnf) in aService.convertedModel.vnfs">
@@ -91,21 +91,24 @@
</ul>
</div>
<!-- <div class="pull-right btn-group" ng-if="aService.model.networks && !equals(aService.model.networks, {})">-->
- <div class="pull-right btn-group" ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks)))">
+ <div class="pull-right btn-group" ng-if="aService.convertedModel.networks && (!(isObjectEmpty(aService.convertedModel.networks))) && isPermitted">
<!--<div class="pull-right btn-group" ng-if="aService.model.networks">-->
<button type="button" data-tests-id="addNetworkButton" class="btn btn-success btn-xs dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Add Network<span class="caret"></span>
</button>
<ul class="dropdown-menu" ng-model="aService.convertedModel.networks">
<li ng-repeat="(networkUuid, network) in aService.convertedModel.networks">
- <a ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
+ <a data-tests-id="addNetworkOption-{{network.modelCustomizationName}}" ng-click="addNetworkInstance(network, aService.instance.vnfs)">{{network.modelCustomizationName}}</a>
</li>
</ul>
</div>
<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeService(aService.instance)" style="margin-right: 8px;">
<span class="glyphicon glyphicon-info-sign"></span>
</a>
- <a data-tests-id="activateButton" class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateMSOInstance()" style="margin-right: 8px;">
+ <a data-tests-id="deactivateButton" ng-disabled="!isActivateDeactivateEnabled('deactivate')" class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="deactivateMSOInstance()" style="margin-right: 8px;">
+ Deactivate
+ </a>
+ <a data-tests-id="activateButton" ng-disabled="!isActivateDeactivateEnabled('activate')" class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="activateMSOInstance()" style="margin-right: 8px;">
Activate
</a>
</div>
@@ -180,7 +183,7 @@
</a>
VFMODULE: {{vfModule.name}} | TYPE: {{vfModule.nodeType}} | ORCH STATUS: {{vfModule.nodeStatus}}
<!-- -->
- <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted" data-tests-id="deleteVFModuleButton" data-nodrag ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
+ <a class="pull-right btn btn-danger btn-xs" ng-if="isPermitted" data-tests-id="deleteVFModuleButton-{{vfModule.name}}" data-nodrag ng-click="deleteVfModule(aService.instance, vfModule, vnf)">
<span class="glyphicon glyphicon-remove"></span>
</a>
<div class="pull-right btn-group">
@@ -196,6 +199,12 @@
<a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="describeVfModule(aService.instance, vfModule, vnf)" style="margin-right: 8px;">
<span class="glyphicon glyphicon-info-sign"></span>
</a>
+ <div class="resume" ng-if="isPermitted&&(vfModule.nodeStatus==resumeStatus)">
+ <a data-tests-id="resumeVFModuleButton-{{vfModule.name}}" class="pull-right btn btn-success btn-xs button-margin" ng-click="resume(aService.instance, vfModule, vnf)" >
+ Resume
+ </a>
+ </div>
+
</div>
<ol ui-tree-nodes="" ng-model="vfModule.volumeGroups" ng-class="{hidden: collapsed}">
<li ng-repeat="volumeGroup in vfModule.volumeGroups" ui-tree-node>
@@ -227,6 +236,7 @@
</ol>
</li>
</ol>
+
<ol ui-tree-nodes="" ng-model="aService.instance.networks" ng-class="{hidden: collapsed}">
<li ng-repeat="network in aService.instance.networks" ui-tree-node>
<div ui-tree-handle class="tree-node tree-node-content">
@@ -244,6 +254,49 @@
</div>
</li>
</ol>
+
+
+ <ol ui-tree-nodes="" ng-model="aService.instance.configurations" ng-class="{hidden: collapsed}">
+ <li ng-repeat="configuration in aService.instance.configurations" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ <a class="btn btn-success btn-xs" ng-if="(configuration.ports && configuration.ports.length > 0)" data-nodrag ng-click="this.toggle()">
+ <span class="glyphicon" ng-class="{'glyphicon-chevron-right': collapsed,'glyphicon-chevron-down': !collapsed}"></span>
+ </a>
+ CONFIGURATION: {{configuration.name}} | TYPE: {{configuration.nodeType}} | ORCH STATUS: {{configuration.nodeStatus}}
+
+ <a class="pull-right btn btn-danger btn-xs" ng-if="!isMacro() && isPermitted && configuration.nodeStatus === STATUS_CONSTANTS.AAI_INACTIVE" data-tests-id="deleteConfigurationButton" data-nodrag ng-click="deleteConfiguration(aService.instance, configuration)">
+ <span class="glyphicon glyphicon-remove"></span>
+ </a>
+
+ <a class="pull-right btn btn-primary btn-xs" data-nodrag ng-click="toggleConfigurationStatus(aService, configuration)" ng-if="isPermitted && allowConfigurationActions">
+ {{configuration.nodeStatus === STATUS_CONSTANTS.AAI_ACTIVE ? "Deactivate" : "Activate"}}
+ </a>
+ </div>
+ <ol ui-tree-nodes="" ng-model="configuration.ports" ng-class="{hidden: collapsed}">
+ <li ng-repeat="port in configuration.ports" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ PORT: {{port.portName}} | ORCH STATUS: {{port.portStatus}}
+
+ <button type="button" class="pull-right btn btn-primary btn-xs" ng-if="configuration.nodeStatus == STATUS_CONSTANTS.AAI_ACTIVE" ng-click="togglePortStatus(aService, configuration, port)">
+ {{port.portStatus === STATUS_CONSTANTS.AAI_ENABLED ? "Disable" : "Enable"}}
+ </button>
+ </div>
+ </li>
+ </ol>
+ </li>
+ </ol>
+
+ <ol id="pnfs-tree" ui-tree-nodes="" ng-model="pnfs" ng-class="{hidden: collapsed || pnf.length === 0}">
+ <li ng-repeat="pnf in pnfs" ui-tree-node>
+ <div ui-tree-handle class="tree-node tree-node-content">
+ PNF: {{pnf}}
+
+ <a class="dissociate-pnf pull-right btn btn-primary btn-xs" data-nodrag ng-click="dissociatePnf(pnf)" style="margin-right: 8px;">
+ <span>Dissociate</span>
+ </a>
+ </div>
+ </li>
+ </ol>
</li>
</ol>
</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm
new file mode 100644
index 000000000..67e9248e8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/messageViewer.htm
@@ -0,0 +1,6 @@
+<div class="message-viewer">
+ <div ng-include src="icon"></div>
+ <div class="primaryMessage">{{ primaryMessage }}</div>
+ <div class="secondaryMessage">{{ secondaryMessage }}</div>
+ <button data-tests-id="try-again" class="btn btn-primary" ng-if="showTryAgain" ng-click="tryAgain()">TRY AGAIN</button>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm
index 48268248b..25a6cf9e0 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/msoCommit.htm
@@ -18,8 +18,8 @@
============LICENSE_END=========================================================
-->
-<div ng-controller="msoCommitController" ng-show="isViewVisible">
-
+<div ng-controller="msoCommitController" ng-show="isViewVisible" >
+<div ng-if="isViewVisible">
<div class="statusLine">
<img src="app/vid/images/spinner.gif"
ngx-visible="{{isSpinnerVisible}}"> </img> <label>Status:</label><span
@@ -45,3 +45,4 @@
ng-click="close();">Close</button>
</div>
</div>
+</div>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm
new file mode 100644
index 000000000..7c1095e6b
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/pnfSearchAssociation.htm
@@ -0,0 +1,62 @@
+<!--
+============LICENSE_START=======================================================
+VID
+================================================================================
+Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<link rel="stylesheet" type="text/css" href="app/vid/styles/networkNode.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/pnfSearchAssociation.css"/>
+<div ng-controller="pnfSearchAssociationController" class="network-wrapper-config pnf-search-association">
+ <div class="head">
+ <div class="title">PNF Model: {{modelName}}</div>
+ <div class="btn-wrapper">
+ <button class="cancel-btn grey" data-tests-id="back" data-ng-click="back()">Back</button>
+ <button class="create-btn blue" data-tests-id="associatePnf" data-ng-disabled="!pnfInstance" data-ng-click="associate()">Associate</button>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="bold" >Unique name of physical network function:</div>
+ <div class="input-wrapper">
+ <input data-tests-id="pnfName" type="search" placeholder="Enter PNF name and click Search" data-ng-model="pnfName" ></input>
+ <div data-tests-id="searchPnf" class="search2-icon search-input" data-ng-click="searchPnf(pnfName)" data-ng-disabled="!pnfName"></div>
+ </div>
+ <div class="result-content margin-search" data-ng-show="pnfInstance">
+ <span ng-show="pnfInstance.pnfName">PNF unique name:</span>
+ <div data-tests-id="pnfInstancePnfName">{{pnfInstance.pnfName}}</div>
+ <span ng-show="pnfInstance.pnfName2" >PNF name:</span>
+ <div data-tests-id="pnfInstancePnfName2">{{pnfInstance.pnfName2}}</div>
+ <span ng-show="pnfInstance.pnfName2Source" >PNF name source:</span>
+ <div data-tests-id="pnfInstancePnfName2Source">{{pnfInstance.pnfName2Source}}</div>
+ <span ng-show="pnfInstance.pnfId">PNF ID:</span>
+ <div data-tests-id="pnfInstancePnfId">{{pnfInstance.pnfId}}</div>
+ <span ng-show="pnfInstance.equipType">Equipment type:</span>
+ <div data-tests-id="pnfInstanceEquipType">{{pnfInstance.equipType}}</div>
+ <span ng-show="pnfInstance.equipVendor">Equipment vendor:</span>
+ <div data-tests-id="pnfInstanceEquipVendor">{{pnfInstance.equipVendor}}</div>
+ <span ng-show="pnfInstance.equipModel">Equipment model:</span>
+ <div data-tests-id="pnfInstanceEquipModel">{{pnfInstance.equipModel}}</div>
+
+ </div>
+ <div class="error-msg margin-search" data-tests-id="pnfNotFoundErrorMessage" data-ng-show="notFound">The specified PNF instance {{pnfNameNotFound}} does not exist in A&AI. <br/>Please note: A&AI is case sensitive</div>
+
+ </div>
+
+ <div class="sidebar-right">
+ <service-metadata title-txt="SERVICE MODEL INFO" service-metadata-fields="serviceMetadataFields"></service-metadata>
+ </div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm
new file mode 100644
index 000000000..a0b94fe4a
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/search.htm
@@ -0,0 +1,5 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/search.css"/>
+<div class="search-container">
+ <input type="search" data-tests-id="test-search-input" class="search-input" ng-model="searchString" ng-model-options="{debounce: 300}" placeholder="Type to search">
+ <div class="search-icon" ng-include src="'app/vid/images/search.svg'"></div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm
new file mode 100644
index 000000000..27992d4a4
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceMetadata.htm
@@ -0,0 +1,10 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceMetadata.css"/>
+<div class="header-title" ng-if="titleTxt">
+ {{titleTxt}}
+</div>
+<div class="metadata-content">
+ <div class="field" ng-repeat="field in serviceMetadataFields">
+ <label>{{field.name}}</label>
+ <div class="value" data-tests-id="{{'info-test-data-id-' + field.name.split(' ').join('')}}">{{field.value}}</div>
+ </div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm
index 3cba87196..17b87bfd2 100755
--- a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceModels.htm
@@ -69,8 +69,8 @@
<td att-table-body ng-bind="service['distributionStatus']"></td>
<td att-table-body ng-bind="service['lastUpdaterUserId']"></td>
<td att-table-body ng-bind="service['toscaModelUrl']"></td>
- <td att-table-body ng-show="service['version'] > '1.0' "><button type=button ng-click="loadPreviousVersionData(service['invariantUUID'],service['name'],service['version'])" att-button btn-type="primary" size="small">Previous Versions</button></td>
- <td att-table-body ng-show="service['version'] <= '1.0' ">&nbsp;</td>
+ <td att-table-body ng-show="service.hasPreviousVersion"><button type=button ng-click="loadPreviousVersionData(service['invariantUUID'],service['name'],service['version'])" att-button btn-type="primary" size="small">Previous Versions</button></td>
+ <td att-table-body ng-show="!service.hasPreviousVersion">&nbsp;</td>
</tr>
</tbody>
</table>
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm
new file mode 100644
index 000000000..e2261dc11
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/serviceProxyConfig.htm
@@ -0,0 +1,108 @@
+<!--
+============LICENSE_START=======================================================
+VID
+================================================================================
+Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+================================================================================
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+============LICENSE_END=========================================================
+-->
+<link rel="stylesheet" type="text/css" href="app/vid/styles/networkNode.css"/>
+<link rel="stylesheet" type="text/css" href="app/vid/styles/serviceProxyConfig.css"/>
+<div class="service-wrapper-config network-wrapper-config">
+ <div class="head">
+ <div class="title">Config {{modelName}}</div>
+ <div class="btn-wrapper">
+ <button class="cancel-btn grey" data-tests-id="backButton" data-ng-click="back()">Back</button>
+ <button class="create-btn blue" data-tests-id="createButton" data-ng-disabled="proxiesInstanceName.$invalid|| disableCreate" data-ng-click="create()">Create</button>
+ </div>
+ </div>
+
+ <div class="content-wrapper">
+ <div class="content">
+ <div class="diagram">
+ <div class="diagram-img">
+ <div class="circle service-circle">
+ <span class="text">Source<br>Service proxy</span>
+ </div>
+ <div class="dotted-line" data-ng-class="{'checked': sourceInstance, 'unchecked': !sourceInstance}">
+ <span class="conn-circle sprite" data-tests-id="sourceInstanceSelectedIcon" data-ng-class="{'valid-large': sourceInstance}"></span>
+ </div>
+ <div class="circle config-circle">
+ <span class="line"></span>
+ </div>
+ <div class="dotted-line" data-ng-class="{'checked': collectorInstance, 'unchecked': !collectorInstance}">
+ <span class="conn-circle sprite" data-tests-id="collectorInstanceSelectedIcon" data-ng-class="{'valid-large': collectorInstance}"></span>
+ </div>
+ <div class="circle service-circle">
+ <span class="text">Collector<br>Service proxy</span>
+ </div>
+ </div>
+ <div class="element-name-wrapper">
+ <div class="element-name service" data-ng-click="openMetadataModal('sourceMetadata')">
+ <span class="label-txt" data-tests-id="sourceInstanceName">{{sourceInstanceName}} <span class="info" data-tests-id="sourceInfoButton">i</span></span>
+
+ </div>
+ <div class="element-name config">
+ <span class="label-txt" data-tests-id="modelName">{{modelName}}</span>
+ </div>
+ <div class="element-name service" data-ng-click="openMetadataModal('collectorMetadata')">
+ <span class="label-txt" data-tests-id="collectorInstanceName">{{collectorInstanceName}}<span class="info" data-tests-id="collectorInfoButton">i</span></span>
+
+ </div>
+ </div>
+ </div>
+ <form name="proxiesInstanceName" class="bottom">
+ <div class="wrapper-list source-vnf">
+ <div class="title-txt"><b>Source</b> Service Type</div>
+ <select ng-model="sourceServiceType"
+ ng-change="onSourceServiceTypeSelected()" name="sourceServiceType" id="sourceServiceType"
+ ng-options="item['service-type'] disable when !(item['is-permitted']) for item in serviceTypes"
+ required data-tests-id="sourceServiceType">
+ <option value="" disabled>Select service type</option>
+ </select>
+
+ <div class="title-txt select-vnf-title">VNF providing <b>source</b> requirements</div>
+ <select ng-model="sourceInstance" name="source" ng-disabled="sourceInstanceList === null" required data-tests-id="sourceDropDown">
+ <option value="" selected>Type/Select VNF name</option>
+ <option ng-repeat="option in sourceInstanceList" data-tests-id="{{'source-' + option.id}}"
+ value="{{option.id}}">{{option['properties']['vnf-name']}}</option>
+ </select>
+ <span class="no-results" data-tests-id="sourceNoResults" ng-show="sourceNoResults">No vnf instances found.</span>
+ </div>
+
+ <div class="wrapper-list collector-{{collectorType}}">
+ <div class="title-txt ng-hide-keep-block" ng-hide="collectorType==='pnf'"><b>Collector</b> Service Type</div>
+ <select ng-model="collectorServiceType" ng-hide="collectorType==='pnf'" class="ng-hide-keep-block"
+ ng-change="onCollectorServiceTypeSelected()" name="collectorServiceType" id="collectorServiceType"
+ ng-options="item['service-type'] disable when !(item['is-permitted']) for item in serviceTypes"
+ required data-tests-id="collectorServiceType">
+ <option value="" disabled>Select service type</option>
+ </select>
+
+ <div class="title-txt select-vnf-title">{{collectorType.toUpperCase()}} providing <b>collector</b> requirements</div>
+ <select ng-model="collectorInstance" name="collector" ng-disabled="collectorInstanceList === null" required data-tests-id="collectorDropDown">
+ <option value="" selected>Type/Select {{collectorType.toUpperCase()}} name</option>
+ <option ng-repeat="option in collectorInstanceList" data-tests-id="{{'collector-' + option.id}}"
+ value="{{option.id}}">{{option['properties'][collectorType=='vnf' ? 'vnf-name' : 'pnfName']}}</option>
+ </select>
+ <span class="no-results" data-tests-id="collectorNoResults" ng-show="collectorNoResults">No {{collectorType}} instances found.</span>
+ </div>
+ </form>
+ </div>
+
+ <div class="sidebar-right">
+ <service-metadata title-txt="info" service-metadata-fields="serviceMetadataFields"></service-metadata>
+ </div>
+ </div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm
new file mode 100644
index 000000000..2c445f8b8
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/scripts/view-models/testEnvironments.htm
@@ -0,0 +1,82 @@
+<link rel="stylesheet" type="text/css" href="app/vid/styles/testEnvironments.css" />
+<link rel="stylesheet" type="text/css" href="app/vid/styles/buttons.css" />
+<div class="test-environments">
+ <div class="header">
+ <div class="header-left">
+ <span data-tests-id="test-environments-headline" class="headline">Test Environments {{vm.total}}</span>
+ <span class="separator"></span>
+ <div class="button-container" ng-click="vm.createNewTestEnvironment()">
+ <div class="icon-svg" data-tests-id="test-environments-new-button">
+ <svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 55.47337 55.63023"><path class="icon-filling" d="M27.7367.07843A27.73669,27.73669,0,1,0,55.4734,27.81512,27.73757,27.73757,0,0,0,27.7367.07843ZM40.18824,29.6178H29.53938V40.26666a1.80267,1.80267,0,0,1-3.60535,0V29.6178H15.28516a1.80267,1.80267,0,0,1,0-3.60535H25.934V15.36359a1.80267,1.80267,0,0,1,3.60535,0V26.01245H40.18824a1.80267,1.80267,0,1,1,0,3.60535Z"/></svg>
+ </div>
+ <span class="button-text">Create New</span>
+ </div>
+ <span class="separator"></span>
+ </div>
+ <search-text data-tests-id="test-environments-search" search-string="vm.searchString"></search-text>
+ </div>
+ <div class="error-messages" ng-if="vm.emptyData || vm.connectError">
+ <message-viewer data-tests-id="test-environments-no-data" primary-message="No test environment was created yet" secondary-message="create new to start testing" icon="app/vid/images/emptyData.svg" class="no-data" ng-if="vm.emptyData">
+ </message-viewer>
+ <message-viewer data-tests-id="test-environments-error" primary-message="Something went wrong" secondary-message="{{vm.connectError}}" icon="app/vid/images/icon_noconnection.svg" try-again="vm.loadAAIestEnvironments()" class="connect-error" ng-if="vm.connectError">
+ </message-viewer>
+ </div>
+ <div class="environments-table" ng-if="vm.environments.length">
+ <div class="row">
+ <div class="col-md-12">
+ <button data-tests-id="test-environments-refresh" class="refresh" type="button" ng-click="vm.loadAAIestEnvironments()">
+ <div ng-include src="'app/vid/images/refresh.svg'"></div>
+ </button>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-md-12 test-environments-table-container">
+ <table data-tests-id="test-environments-table" att-table table-data="vm.environments" search-category="searchCategory" search-string="vm.searchString" class="table table-bordered" id="environments-table">
+ <thead att-table-row type="header" class="thead-default">
+ <tr>
+ <th att-table-header default-sort="A" key="operationalEnvironmentId">Environment ID</th>
+ <th att-table-header key="operationalEnvironmentName">Environment Name</th>
+ <th att-table-header key="relationshipList.relationship[0].relationshipData[0].relationshipValue">ECOMP Environment ID</th>
+ <th att-table-header key="relationshipList.relationship[0].relatedToProperty[0].propertyValue">ECOMP Environment Name</th>
+ <th att-table-header key="tenantContext">Tenant Context</th>
+ <th att-table-header key="operationalEnvironmentType">Environment Type</th>
+ <th att-table-header key="workloadContext">Workload Context</th>
+ <th att-table-header sortable="false">Status</th>
+ <th att-table-header sortable="false">Action</th>
+ <th att-table-header sortable="false">Attach Manifest</th>
+ </tr>
+ </thead>
+ <tbody att-table-row type="body" row-repeat="environment in vm.environments">
+ <tr>
+ <td att-table-body ng-bind="environment.operationalEnvironmentId"></td>
+ <td att-table-body ng-bind="environment.operationalEnvironmentName"></td>
+ <td att-table-body ng-bind="environment.relationshipList.relationship[0].relationshipData? environment.relationshipList.relationship[0].relationshipData[0].relationshipValue: ''"></td>
+ <td att-table-body ng-bind="environment.relationshipList.relationship[0].relatedToProperty? environment.relationshipList.relationship[0].relatedToProperty[0].propertyValue: ''"></td>
+ <td att-table-body ng-bind="environment.tenantContext"></td>
+ <td att-table-body ng-bind="environment.operationalEnvironmentType"></td>
+ <td att-table-body ng-bind="environment.workloadContext"></td>
+ <td att-table-body ng-bind="vm.getEnvStatus(environment)" id="testEnvStatus-{{environment.operationalEnvironmentId}}"></td>
+ <td att-table-body>
+ <button id="testEnvActivate-{{environment.operationalEnvironmentId}}" type="button" class="blue envActionBtn"
+ ng-click="vm.onTestEnvActivateClick(environment)" ng-show="!vm.isEnvActive(environment)">Activate</button>
+ <button id="testEnvDeactivate-{{environment.operationalEnvironmentId}}" type="button" class="blue envActionBtn"
+ ng-click="vm.onTestEnvDeactivateClick(environment)" ng-show="vm.isEnvActive(environment)">Deactivate</button>
+ </td>
+ <td att-table-body>
+ <button id="testEnvAttach-{{environment.operationalEnvironmentId}}" class="transparent attach-button"
+ ng-click="vm.onTestEnvActivateClick(environment)" ng-show="vm.isEnvActive(environment)">
+ <img src="app/vid/images/attach.svg">
+ </button>
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ </div>
+ </div>
+ </div>
+</div>
+<div popup-window class="popupContents" ngx-show="{{popup.isVisible}}"
+ ng-cloak>
+ <div ng-include="'app/vid/scripts/view-models/msoCommit.htm'"></div>
+</div> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/buttons.css b/vid-app-common/src/main/webapp/app/vid/styles/buttons.css
new file mode 100644
index 000000000..7a2a90154
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/buttons.css
@@ -0,0 +1,58 @@
+button {
+ border-radius: 2px;
+ font-size: 14px;
+ line-height: 28px;
+ height: 30px;
+}
+
+button.blue {
+ border: #0091c8 1px solid;
+ background-color: #009fdb;
+ color: white;
+}
+button.blue:hover {
+ background-color: #1ec2ff;
+ border-color: #0091c8;
+}
+button.blue:active {
+ background-color: #0091c7;
+ border-color: #006186;
+}
+button.blue[disabled] {
+ background-color: rgba(5, 104, 174, 0.3);
+ border-color: rgba(4, 113, 168, 0.3);
+}
+
+
+button.transparent {
+ border: 0;
+ background-color: transparent;
+ outline: none;
+}
+button.transparent:hover {
+ background-color: transparent;
+}
+button.transparent:active {
+ background-color: transparent;
+}
+button.transparent[disabled] {
+ background-color: transparent;
+}
+
+.clickable-text {
+ font-size: 12px !important;
+ color: #337ab7; !important;
+ text-decoration: none;
+ text-decoration-line: none !important;
+}
+.clickable-text:hover {
+ color: #23527c !important;
+ text-decoration: none;
+ text-decoration-line: none !important;
+}
+.clickable-text:active {
+ color: #0091c7 !important;
+}
+.clickable-text[disabled] {
+ color: rgba(5, 104, 174, 0.3) !important;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css b/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css
index 8c4dbd8c5..7e9620a37 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/change-management-icons.css
@@ -51,8 +51,13 @@
color: #5a5a5a;
}
.icon-pending:before {
+ content: "\e905";
+ color: #00aeef;
+ cursor: pointer;
+ }
+.icon-deleted:before {
content: "\e905";
- color: #00aeef;
+ color: #cf2a2a;
cursor: pointer;
}
.icon-plus:before {
@@ -80,3 +85,63 @@
font-size: 12px;
cursor: pointer;
}
+.icon-search-in:before {
+ content: "\e90d";
+ color: #009FDB;
+ font-size: 17px;
+ cursor: pointer;
+}
+.expand-icon{
+ margin-right: 10px;
+ position: relative;
+ width: 11px;
+ height: 11px;
+ display: inline-block;
+ cursor: pointer;
+}
+
+/* Vertical line */
+.expand-icon:before{
+ content: "";
+ position: absolute;
+ background-color: #5a5a5a;
+ transition: transform 0.25s ease-out;
+ right: 40%;
+ width: 2px;
+ height: 100%;
+ margin-left: 5px;
+}
+
+/* horizontal line */
+.expand-icon:after{
+ content: "";
+ position: absolute;
+ background-color: #5a5a5a;
+ transition: transform 0.25s ease-out;
+ top: 40%;
+ left: 0;
+ width: 100%;
+ height: 2px;
+}
+.collapse-icon{
+ margin-right: 10px;
+ cursor: pointer;
+ display: inline-block;
+ width: 10px;
+ border-top: 1.6px solid #5a5a5a;
+ padding: 2.6px;
+}
+.icon-search2:before {
+ content: "\e90d";
+ color: #009FDB;
+ font-size: 40px;
+ cursor: pointer;
+}
+.icon-sync:before {
+ content: "\e90f";
+ font-size: 20px;
+ cursor: pointer;
+}
+.icon-sync:hover:before {
+ color: #009FDB;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/change-management.css b/vid-app-common/src/main/webapp/app/vid/styles/change-management.css
index 68a06ee16..7edbea030 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/change-management.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/change-management.css
@@ -90,7 +90,7 @@
}
.jobs-table {
- background-color: #f8f8f8;
+ background-color: #ffffff;
padding: 40px;
}
@@ -119,7 +119,7 @@
border: 1px solid #eaeaea;
box-sizing: border-box;
background-color: #ffffff;
- box-shadow: 0px 2px 7px 0px rgba(34, 31, 31, 0.17);
+ /* box-shadow: 0px 2px 7px 0px rgba(34, 31, 31, 0.17);*/
font-family: "Open Sans";
color: #5a5a5a;
font-size: 14px;
@@ -127,7 +127,7 @@
}
.table>thead {
- background-color: #d2d2d2;
+ background-color: #F2F2F2;
font-family: "Open Sans";
color: #191919;
font-size: 13px;
@@ -140,7 +140,7 @@
color: #00aeef;
font-size: 14px;
font-weight: 600;
- background-color: #eaeaea;
+ background-color: #EAEAEA;
box-shadow: 0px 1px 1px 0px rgba(34, 31, 31, 0.19);
}
@@ -154,4 +154,24 @@
.centered {
text-align: center;
+}
+.table-wrapper{
+}
+
+.refresh-cm {
+ float: right;
+ position: relative;
+ right: 45px;
+ top: 50px;
+ z-index: 900;
+ color: #191919;
+ font-size: 14px;
+}
+.refresh-cm .last-time-updated {
+ color: #5A5A5A;
+}
+.refresh-cm i.icon-sync {
+ padding-left: 10px;
+ top: 3px;
+ position: relative;
} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/common.css b/vid-app-common/src/main/webapp/app/vid/styles/common.css
index 8d6fb615b..35f2e33f8 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/common.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/common.css
@@ -1,3 +1,116 @@
+@font-face {
+ font-family: OpenSans-Bold;
+ src: url("fonts/OpenSans/OpenSans-Bold.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-BoldItlaic;
+ src: url("fonts/OpenSans/OpenSans-BoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-ExtraBold;
+ src: url("fonts/OpenSans/OpenSans-ExtraBold.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-ExtraBoldItalic;
+ src: url("fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Italic;
+ src: url("fonts/OpenSans/OpenSans-Italic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Light;
+ src: url("fonts/OpenSans/OpenSans-Light.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-LightItalic;
+ src: url("fonts/OpenSans/OpenSans-LightItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Regular;
+ src: url("fonts/OpenSans/OpenSans-Regular.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Semibold;
+ src: url("fonts/OpenSans/OpenSans-Semibold.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-SemiboldItalic;
+ src: url("fonts/OpenSans/OpenSans-SemiboldItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: 'icomoon';
+ src: url('fonts/icomoon.eot?4cilop');
+ src: url('fonts/icomoon.eot?4cilop#iefix') format('embedded-opentype'),
+ url('fonts/icomoon.ttf?4cilop') format('truetype'),
+ url('fonts/icomoon.woff?4cilop') format('woff'),
+ url('fonts/icomoon.svg?4cilop#icomoon') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+
html, body {
font-size:14px;
-} \ No newline at end of file
+}
+
+.button--inactive {
+ border: none !important;
+}
+
+.modal-body [class^="icon-"],.modal-body [class*=" icon-"] {
+ /* use !important to prevent issues with browser extensions that change fonts */
+ font-family: 'icomoon' !important;
+ speak: none;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+
+ /* Better Font Rendering =========== */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.icon-browse:before {
+ content: "\e90e";
+ color: #5A5A5A;
+ font-size: 4px;
+ cursor: pointer;
+ width: 37px;
+ height: 37px;
+ line-height: 37px;
+ text-align: center;
+ background: #F2F2F2;
+ border: 1px solid #D2D2D2;
+ display: inline-block;
+ vertical-align: top;
+ border-radius: 2px;
+ border-bottom-left-radius: 0;
+ border-top-left-radius: 0;
+}
+
+.icon-browse:hover::before {
+ background-color: #E6F6FB;
+ color: #009FDB;
+}
+
+.icon-browse:active::before {
+ background-color: #E6F6FB;
+ color: #009FDB;
+}
+
+input:focus:invalid {
+ border-color: Tomato;
+ box-shadow: none;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt
new file mode 100644
index 000000000..989e2c59e
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/Apache License.txt
@@ -0,0 +1,201 @@
+Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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. \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttf
new file mode 100644
index 000000000..fd79d43be
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Bold.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttf
new file mode 100644
index 000000000..9bc800958
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-BoldItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttf
new file mode 100644
index 000000000..21f6f84a0
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBold.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf
new file mode 100644
index 000000000..31cb68834
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttf
new file mode 100644
index 000000000..c90da48ff
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Italic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttf
new file mode 100644
index 000000000..0d381897d
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Light.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttf
new file mode 100644
index 000000000..68299c4bc
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-LightItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttf
new file mode 100644
index 000000000..db433349b
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Regular.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttf
new file mode 100644
index 000000000..1a7679e39
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-Semibold.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttf
new file mode 100644
index 000000000..59b6d16b0
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/OpenSans/OpenSans-SemiboldItalic.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot
index e57ccc5e7..9a031a85b 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.eot
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg
index 5d514c47b..3b288d8c1 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.svg
@@ -20,4 +20,7 @@
<glyph unicode="&#xe90a;" glyph-name="noun_573805_cc-03" d="M512.211 960c-282.886 0-512.211-229.325-512.211-512.211s229.325-512.211 512.211-512.211c282.887 0 512.211 229.325 512.211 512.211v0c-0.017 282.88-229.332 512.195-512.21 512.211h-0.001zM261.202 377.71c-38.703 0-70.079 31.375-70.079 70.079s31.375 70.079 70.079 70.079c38.703 0 70.079-31.375 70.079-70.079v0c0.005-0.298 0.007-0.649 0.007-1.001 0-38.155-30.93-69.085-69.085-69.085-0.352 0-0.703 0.003-1.054 0.008l0.053-0.001zM512.211 377.71c-38.703 0-70.079 31.375-70.079 70.079s31.375 70.079 70.079 70.079c38.703 0 70.079-31.375 70.079-70.079v0c0-0.061 0-0.133 0-0.205 0-38.59-31.284-69.874-69.874-69.874-0.072 0-0.144 0-0.216 0h0.011zM763.221 377.71c-38.703 0-70.079 31.375-70.079 70.079s31.375 70.079 70.079 70.079c38.703 0 70.079-31.375 70.079-70.079v0c0-0.061 0-0.133 0-0.205 0-38.59-31.284-69.874-69.874-69.874-0.072 0-0.144 0-0.217 0h0.011z" />
<glyph unicode="&#xe90b;" glyph-name="scedular" horiz-adv-x="981" d="M981.333 662.699c0.312 4.17 0.49 9.033 0.49 13.938 0 109.691-88.922 198.613-198.613 198.613-5.353 0-10.656-0.212-15.902-0.627l0.693 0.044h-554.667c-4.553 0.371-9.857 0.583-15.21 0.583-109.691 0-198.613-88.922-198.613-198.613 0-4.905 0.178-9.768 0.527-14.583l-0.038 0.645v-470.699c0-128.811 82.475-256 213.333-256h554.667c130.859 0 213.333 127.189 213.333 256v470.699zM36.352 662.699c0 109.141 66.048 169.301 176.981 169.301h554.667c110.933 0 176.981-60.16 176.981-169.301l-6.315-44.032h-896zM938.667 192c0-109.141-59.733-213.333-170.667-213.333h-554.667c-110.933 0-170.667 104.192-170.667 213.333v384h896v-384zM362.667 405.333h256c11.782 0 21.333-9.551 21.333-21.333s-9.551-21.333-21.333-21.333v0h-256c-11.782 0-21.333 9.551-21.333 21.333s9.551 21.333 21.333 21.333v0zM362.667 234.667h256c11.782 0 21.333-9.551 21.333-21.333s-9.551-21.333-21.333-21.333v0h-256c-11.782 0-21.333 9.551-21.333 21.333s9.551 21.333 21.333 21.333v0zM704 960c11.782 0 21.333-9.551 21.333-21.333v0-170.667c0-11.782-9.551-21.333-21.333-21.333s-21.333 9.551-21.333 21.333v0 170.667c0 11.782 9.551 21.333 21.333 21.333v0zM277.333 960c11.782 0 21.333-9.551 21.333-21.333v0-170.667c0-11.782-9.551-21.333-21.333-21.333s-21.333 9.551-21.333 21.333v0 170.667c0 11.782 9.551 21.333 21.333 21.333v0z" />
<glyph unicode="&#xe90c;" glyph-name="finished_d" d="M512 960v0c-282.77 0-512-229.23-512-512v0c0-282.77 229.23-512 512-512s512 229.23 512 512c0 282.77-229.23 512-512 512zM473.454 273.993c8.558 13.239 15.067 22.894 21.138 32.768 91.648 149.211 118.126 170.569 209.701 319.781 5.105 9.183 10.457 17.077 16.416 24.459l-0.252-0.322c8.798 10.219 21.751 16.651 36.206 16.651 9.048 0 17.507-2.52 24.715-6.896l-0.212 0.119c13.74-7.345 22.93-21.594 22.93-37.989 0-6.179-1.305-12.053-3.655-17.361l0.108 0.274c-3.479-7.646-7.067-14.1-11.098-20.236l0.346 0.561c-108.251-176.859-151.479-225.646-259.803-402.286-7.527-16.71-24.034-28.132-43.21-28.132-13.809 0-26.235 5.924-34.874 15.369l-0.032 0.036q-107.52 91.502-213.138 184.978c-11.444 7.654-18.878 20.525-18.878 35.132 0 11.575 4.668 22.060 12.224 29.675l-0.003-0.003c9.080 9.371 21.781 15.187 35.84 15.187s26.76-5.816 35.827-15.174l0.013-0.013c46.738-39.643 92.672-80.457 138.971-120.32z" />
+<glyph unicode="&#xe90d;" glyph-name="search2" d="M421.647 182.965c-96.376 0-180.706 36.141-252.988 102.4-66.259 66.259-102.4 156.612-102.4 252.988s36.141 180.706 102.4 252.988c66.259 66.259 156.612 102.4 252.988 102.4s180.706-36.141 252.988-102.4c66.259-66.259 102.4-156.612 102.4-252.988s-36.141-180.706-102.4-252.988c-72.282-66.259-156.612-102.4-252.988-102.4zM1011.953-9.788l-271.059 271.059c66.259 78.306 102.4 174.682 102.4 271.059 0 114.447-42.165 216.847-120.471 295.153s-186.729 120.471-295.153 120.471c-114.447 0-216.847-42.165-295.153-120.471s-120.471-186.729-120.471-295.153c0-114.447 42.165-216.847 120.471-295.153s186.729-120.471 295.153-120.471c102.4 0 198.776 36.141 271.059 102.4l271.059-271.059c6.024-6.024 18.071-12.047 24.094-12.047s18.071 6.024 24.094 12.047c12.047 12.047 12.047 30.118-6.024 42.165z" />
+<glyph unicode="&#xe90e;" glyph-name="browse" horiz-adv-x="3584" d="M796.444 561.778c0-219.932-178.29-398.222-398.222-398.222s-398.222 178.29-398.222 398.222c0 219.932 178.29 398.222 398.222 398.222s398.222-178.29 398.222-398.222zM3584 561.778c0-219.932-178.29-398.222-398.222-398.222s-398.222 178.29-398.222 398.222c0 219.932 178.29 398.222 398.222 398.222s398.222-178.29 398.222-398.222zM2190.222 561.778c0-219.932-178.29-398.222-398.222-398.222s-398.222 178.29-398.222 398.222c0 219.932 178.29 398.222 398.222 398.222s398.222-178.29 398.222-398.222z" />
+<glyph unicode="&#xe90f;" glyph-name="sync" d="M878.933 358.4c21.333-4.267 34.176-29.867 29.867-55.467-21.333-59.733-59.691-115.2-102.357-157.867-81.109-81.067-187.776-123.733-302.976-123.733s-221.867 42.667-294.357 123.733l-123.776 119.467v-157.867c0-25.6-17.067-42.667-42.667-42.667-25.557 0-42.667 17.067-42.667 42.667v268.8c0 4.267 4.267 4.267 4.267 8.533 4.309 0 4.309 4.267 4.309 4.267 0 4.267 4.224 8.533 8.533 8.533 0 4.267 4.224 4.267 4.224 4.267h4.267c0 4.267 4.309 4.267 8.533 4.267h256c25.643 0 42.667-17.067 42.667-42.667s-17.024-42.667-42.667-42.667h-149.333l119.467-110.933c68.309-68.267 153.643-102.4 243.2-102.4 89.643 0 179.2 34.133 238.976 98.133 38.357 34.133 64 81.067 81.024 128 8.533 21.333 34.133 34.133 55.467 25.6zM958.406 831.276c25.6 0 42.667-17.067 42.667-42.667v-260.267c0-4.267 0-8.533-4.267-12.8 0-4.267-4.267-4.267-4.267-8.533-4.267 0-4.267-4.267-4.267-4.267-4.267-4.267-8.533-4.267-12.8-8.533s-12.8-4.267-17.067-4.267h-256c-25.6 0-42.667 17.067-42.667 42.667s17.067 42.667 42.667 42.667h149.333l-119.467 115.2c-34.133 38.4-81.067 64-128 81.067-85.333 29.867-179.2 25.6-260.267-12.8-81.067-42.667-145.067-110.933-174.933-196.267-8.533-21.333-34.133-34.133-55.467-25.6-21.333 4.267-34.133 29.867-25.6 51.2 38.4 110.933 115.2 196.267 217.6 243.2 102.4 51.2 217.6 55.467 328.533 21.333 59.733-21.333 115.2-59.733 157.867-102.4l123.733-119.467v157.867c0 25.6 17.067 42.667 42.667 42.667z" />
</font></defs></svg> \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf
index 7d0e36d1f..acbb2aa5b 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.ttf
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff
index b2d2e64af..8a7b316c0 100644
--- a/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff
+++ b/vid-app-common/src/main/webapp/app/vid/styles/fonts/icomoon.woff
Binary files differ
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css b/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css
index 13e2cf0a5..e46a8b970 100755
--- a/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/instantiate.css
@@ -59,4 +59,12 @@ div[ng-controller=InstantiationController] .aaiHidden {
div[ng-controller=InstantiationController] .aaiVisible {
visibility: visible;
+}
+
+div.resume {
+ display: inline;
+}
+
+a.button-margin {
+ margin-right: 8px;
} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css b/vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css
new file mode 100644
index 000000000..9514d11b4
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/messageViewer.css
@@ -0,0 +1,17 @@
+.message-viewer {
+ text-align: center;
+}
+
+.message-viewer .primaryMessage {
+ font-size: 18px;
+ padding-top: 20px;
+}
+
+.message-viewer .btn-primary {
+ background-color: #009FDB;
+ color: #FFFFFF;
+ border: 1px solid #009FDB;
+ padding: 0px 25px;
+ height: 35px;
+ margin-top: 45px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css b/vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css
new file mode 100644
index 000000000..b5d3d3143
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/modal-buttons.css
@@ -0,0 +1,29 @@
+.modal-footer .btn-white,
+.modal-footer .btn-white:hover {
+ font-family: "OpenSans-Semibold";
+ border-radius: 5px;
+ border: 1px solid #009FDB;
+ background-color: #FFFFFF;
+ width: 120px;
+ height: 36px;
+ color: #009FDB;
+ font-size: 13px;
+ line-height: 30px;
+ text-align: center;
+ padding: 4px 12px !important;
+}
+
+.modal-footer .btn-primary,
+.modal-footer .btn-primary:hover{
+ font-family: "OpenSans-Semibold";
+ border-radius: 5px;
+ border: 1px solid #009FDB;
+ background-color: #009FDB;
+ width: 120px;
+ height: 36px;
+ color: #FFFFFF;
+ font-size: 13px;
+ line-height: 30px;
+ text-align: center;
+ padding: 4px 12px !important;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css
new file mode 100644
index 000000000..1a293c049
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/modal-create-new.css
@@ -0,0 +1,196 @@
+.modal-dialog {
+ width: 587px;
+ border-radius: 8px;
+}
+
+.modal-content {
+ width: 587px;
+ border-radius: 8px;
+ background-color: #ffffff;
+ font-family: "OpenSans-Regular";
+}
+
+.modal-content .modal-body {
+ padding: 15px 35px 5px 35px;
+}
+
+.modal-body .connect-error,
+.modal-body .icon-alert.error {
+ font-family: OpenSans-Regular !important;
+ color: #CF2A2A;
+ font-size: 14px;
+}
+
+.modal-body .icon-alert:before {
+ color: #CF2A2A;
+ cursor: default;
+ font-family: 'icomoon' !important;
+ padding-right: 5px;
+}
+
+.modal-header {
+ border: none!important;
+ padding: 15px 35px 0px 35px!important;
+}
+
+.modal-header h3 {
+ font-family: "OpenSans-Regular";
+ color: #191919;
+ font-size: 22px;
+ font-weight: 300;
+ line-height: 16px;
+ padding-bottom: 20px;
+ border-bottom: 3px solid #009fdb;
+
+}
+
+.modal-close {
+ margin: -40px 5px 0 0;
+ color: #5a5a5a;
+ font-size: 20px;
+ cursor: pointer;
+}
+
+.form-group .control-label {
+ font-family: OpenSans-Semibold;
+ font-size: 12px;
+ color: #191919;
+}
+
+select {
+ background: url(../images/chevron.png) no-repeat 98% 10px !important;
+}
+
+input::placeholder {
+ text-align: left;
+ font-family: OpenSans-Regular;
+ font-size: 14px;
+ color: #a9a9a9;
+}
+
+.form-group .connect-error {
+ border: 1.5px solid #CF2A2A;
+}
+
+.form-group .grayedOut {
+ font-family: OpenSans-Regular;
+ font-size: 14px;
+ color: #a9a9a9;
+ opacity: 0.54;
+}
+
+.form-group .grayedOut option {
+ font-family: OpenSans-Regular;
+ font-size: 14px;
+ color: #555;
+ opacity: 1;
+}
+
+button.dropdown-toggle {
+ text-align: left;
+}
+
+button[disabled].dropdown-toggle {
+ opacity: 1;
+ cursor: not-allowed;
+ background-color: #eee;
+ border: 1px solid #aaa;
+ color: #a0a0a0;
+}
+
+multiselect[disabled] {
+ cursor: not-allowed;
+}
+
+a.item-unselected:before {
+ font-family: "icomoon"!important;
+ content: "\e90c";
+ color: #4ca90c;
+}
+
+.form-create .modal-footer {
+ margin-top: 0;
+}
+
+.form-create .modal-footer .btn,
+.form-create .modal-footer .btn:hover {
+ font-family: "OpenSans-Semibold";
+ border-radius: 5px;
+ border: 1px solid #009FDB;
+ font-size: 13px;
+ line-height: 30px;
+ text-align: center;
+ padding: 4px 12px !important;
+ width: 120px;
+ height: 36px;
+}
+
+.form-create .modal-footer .btn-white,
+.form-create .modal-footer .btn-white:hover {
+ background-color: #FFFFFF;
+ color: #009FDB;
+}
+
+.form-create .modal-footer .btn-primary,
+.form-create .modal-footer .btn-primary:hover{
+ background-color: #009FDB;
+ color: #FFFFFF;
+}
+
+.vnf-versions-container .table {
+ position: relative;
+ background-color: #f8f8f8;
+ background-clip: padding-box;
+ border-radius: 6px;
+ outline: 0;
+}
+
+.file-wrapper {
+ display: flex;
+}
+
+.file-input {
+ display: inline-block !important;
+ width: 0.1px;
+}
+
+.file-input-label {
+ width: 389px;
+ height: 37px;
+ background: #FFFFFF;
+ border: 1px solid #D2D2D2;
+ border-radius: 2px;
+ display: inline-block;
+ line-height: 37px;
+ font-weight: normal !important;
+ padding-left: 12px;
+ border-bottom-right-radius: 0;
+ border-top-right-radius: 0;
+ flex: 1;
+}
+
+.vnf-versions-name {
+ padding-top: 6px;
+ font-family: "OpenSans-Regular";
+ position: absolute;
+}
+
+.vnf-versions-select-as-text {
+ font-family: "OpenSans-Regular";
+ appearance: none;
+ -webkit-appearance: none;
+ -moz-appearance: none;
+ border: none;
+ overflow:hidden;
+ background-color: #f8f8f8;
+ height: 31px;
+}
+
+.vnf-files-select {
+ z-index: 999;
+ opacity: 0.0;
+ position: absolute;
+ width: 23%;
+ cursor: pointer;
+ height:100%;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/modals.css b/vid-app-common/src/main/webapp/app/vid/styles/modals.css
new file mode 100644
index 000000000..edc89b968
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/modals.css
@@ -0,0 +1,52 @@
+@font-face {
+ font-family: OpenSans-Light;
+ src: url("fonts/OpenSans/OpenSans-Light.ttf") format('truetype');
+}
+@font-face {
+ font-family: OpenSans-Regular;
+ src: url("fonts/OpenSans/OpenSans-Regular.ttf") format('truetype');
+}
+@font-face {
+ font-family: OpenSans-Semibold;
+ src: url("fonts/OpenSans/OpenSans-Semibold.ttf") format('truetype');
+}
+
+.modal-header * {
+ font-family: OpenSans-Light;
+}
+.modal-body * {
+ font-family: OpenSans-Regular;
+}
+.modal-footer * {
+ font-family: OpenSans-Semibold;
+}
+
+.modal-header {
+ border-bottom: 3px solid;
+ margin: auto;
+ width: 95%;
+ padding: 10px 0;
+ font-size: 22px;
+}
+.modal-header #cancel {
+ cursor: pointer;
+}
+.modal-title {
+ float: left;
+}
+.modal-content {
+ font-size: 15px;
+ border-radius: 0;
+ color: #191919;
+}
+.modal-footer {
+ background-color: #F8F8F8;
+ height: 60px;
+}
+.modal-footer .btn {
+ color: #FFF;
+ background-color: #009FDB;
+ border-color: #009FDB;
+ margin-right: 0;
+ font-size: 13px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/networkNode.css b/vid-app-common/src/main/webapp/app/vid/styles/networkNode.css
new file mode 100644
index 000000000..74fa9fcbe
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/networkNode.css
@@ -0,0 +1,271 @@
+@font-face {
+ font-family: OpenSans-Bold;
+ src: url("fonts/OpenSans/OpenSans-Bold.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-BoldItlaic;
+ src: url("fonts/OpenSans/OpenSans-BoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-ExtraBold;
+ src: url("fonts/OpenSans/OpenSans-ExtraBold.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-ExtraBoldItalic;
+ src: url("fonts/OpenSans/OpenSans-ExtraBoldItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Italic;
+ src: url("fonts/OpenSans/OpenSans-Italic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Light;
+ src: url("fonts/OpenSans/OpenSans-Light.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-LightItalic;
+ src: url("fonts/OpenSans/OpenSans-LightItalic.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Regular;
+ src: url("fonts/OpenSans/OpenSans-Regular.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-Semibold;
+ src: url("fonts/OpenSans/OpenSans-Semibold.ttf") format('truetype');
+}
+
+@font-face {
+ font-family: OpenSans-SemiboldItalic;
+ src: url("fonts/OpenSans/OpenSans-SemiboldItalic.ttf") format('truetype');
+}
+
+.templatebody{
+ background-color: white !important;
+}
+.network-wrapper-config * {
+ font-family: OpenSans-Regular, sans-serif;
+}
+.body-content-jsp {
+ margin-top: 35px;
+ margin-left: 201px;
+ margin-right: 0px;
+ background-color: white;
+}
+.temporary-solution {
+ height: 0px;
+}
+.sprite {
+ background: url('../images/sprite.png') no-repeat;
+ display: inline-block;
+}
+.modal-x {
+ background-position: -198px -315px;
+ width: 10px;
+ height: 10px;
+}
+.modal-x:hover{
+ background-position: -198px -338px;
+}
+.sprite.checkbox {
+ background-position: -218px -335px;
+ width: 14px;
+ height: 14px;
+}
+.sprite.checkbox-checked {
+ background-position: -218px -311px;
+}
+.sprite.checkbox-disabled {
+ background-position: -218px -359px;
+}
+button {
+ border-radius: 2px;
+ font-size: 14px;
+ line-height: 28px;
+ height: 30px;
+}
+button.blue {
+ border: #0091c8 1px solid;
+ background-color: #009fdb;
+ color: white;
+}
+button.blue:hover {
+ background-color: #1ec2ff;
+ border-color: #0091c8;
+}
+button.blue:active {
+ background-color: #0091c7;
+ border-color: #006186;
+}
+button.blue[disabled] {
+ background-color: rgba(5, 104, 174, 0.3);
+ border-color: rgba(4, 113, 168, 0.3);
+}
+button.grey {
+ color: #009FDB;
+ background-color: #ffffff;
+ border: 1px solid #009FDB;
+}
+button.grey:hover {
+ background-color: #f8f8f8;
+ border-color: #009fdb;
+}
+button.grey:active {
+ background-color: #d8d8d8;
+ border-color: #5a5a5a;
+}
+button.grey[disabled] {
+ background-color: #f8f8f8;
+ border-color: #d8d8d8;
+ color: #cdcdcd;
+}
+button.white {
+ border: #009fdb 1px solid;
+ background-color: white;
+ color: #009fdb;
+}
+input[type=checkbox] {
+ display: none;
+}
+input[type=checkbox] + label {
+ position: relative;
+ padding-left: 2px;
+ text-indent: 19px;
+ line-height: 15px;
+}
+input[type=checkbox] + label::after {
+ background: url('../images/sprite.png') no-repeat;
+ display: inline-block;
+ background-position: -218px -335px;
+ width: 14px;
+ height: 14px;
+ padding-left: 21px;
+ margin-right: 25px;
+ line-height: 15px;
+ color: #5a5a5a;
+ content: '';
+ position: absolute;
+ left: 0;
+ top: 0;
+}
+input[type=checkbox] + label::after.checkbox {
+ background-position: -218px -335px;
+ width: 14px;
+ height: 14px;
+}
+input[type=checkbox] + label::after.checkbox-checked {
+ background-position: -218px -311px;
+}
+input[type=checkbox] + label::after.checkbox-disabled {
+ background-position: -218px -359px;
+}
+input[type=checkbox]:checked + label::after {
+ background: url('../images/sprite.png') no-repeat;
+ display: inline-block;
+ background-position: -218px -311px;
+}
+input[type=checkbox]:checked + label::after.checkbox {
+ background-position: -218px -335px;
+ width: 14px;
+ height: 14px;
+}
+input[type=checkbox]:checked + label::after.checkbox-checked {
+ background-position: -218px -311px;
+}
+input[type=checkbox]:checked + label::after.checkbox-disabled {
+ background-position: -218px -359px;
+}
+input[type=checkbox]:disabled + label::after {
+ background: url('../images/sprite.png') no-repeat;
+ display: inline-block;
+ background-position: -218px -359px;
+}
+input[type=checkbox]:disabled + label::after.checkbox {
+ background-position: -218px -335px;
+ width: 14px;
+ height: 14px;
+}
+input[type=checkbox]:disabled + label::after.checkbox-checked {
+ background-position: -218px -311px;
+}
+input[type=checkbox]:disabled + label::after.checkbox-disabled {
+ background-position: -218px -359px;
+}
+.network-wrapper-config {
+ width: 100%;
+}
+.network-wrapper-config .head {
+ line-height: 59px;
+ height: 59px;
+ display: flex;
+ background-color: #F8F8F8;
+ border-bottom: 1px solid #D8D8D8;
+}
+.network-wrapper-config .head .title {
+ font-size: 18px;
+ margin-left: 56px;
+ color: #5A5A5A;
+}
+.network-wrapper-config .head .btn-wrapper {
+ flex: 1;
+ text-align: right;
+ margin-right: 15px;
+}
+.network-wrapper-config .head .btn-wrapper button {
+ width: 120px;
+}
+.network-wrapper-config .head .btn-wrapper button.delete-btn{
+ margin-left: 13px;
+}
+.network-wrapper-config .content-wrapper {
+ display: flex;
+}
+.network-wrapper-config .content-wrapper .sidebar-right {
+ width: 25%;
+ min-width: 400px;
+ background-color: #F8F8F8;
+}
+.network-wrapper-config .content-wrapper .content {
+ width: 75%;
+ margin-top: 48px;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper {
+ width: 640px;
+ margin: 0 auto;
+}
+.network-wrapper-config span.error {
+ color: #cf2a2a;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field .ng-invalid-pattern{
+ border-color: #cf2a2a;
+ color: #cf2a2a;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field {
+ margin-bottom: 25px;
+}
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field label{
+ color: #191919;
+ font-size: 13px;
+}
+
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field input,
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field select{
+ border-color: #D2D2D2;
+}
+
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field.lcpRegionText,
+.network-wrapper-config .content-wrapper .content .form-wrapper .instance-field.productFamily{
+ display: none;
+}
+
+.sidebar-right service-metadata .metadata-content{
+ padding-bottom: 20px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css b/vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css
new file mode 100644
index 000000000..5cf16d83c
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/pnfSearchAssociation.css
@@ -0,0 +1,82 @@
+@font-face {
+ font-family: 'icomoon';
+ src: url('fonts/icomoon.eot?4cilop');
+ src: url('fonts/icomoon.eot?4cilop#iefix') format('embedded-opentype'),
+ url('fonts/icomoon.ttf?4cilop') format('truetype'),
+ url('fonts/icomoon.woff?4cilop') format('woff'),
+ url('fonts/icomoon.svg?4cilop#icomoon') format('svg');
+ font-weight: normal;
+ font-style: normal;
+}
+
+.pnf-search-association [class^="icon-"],.pnf-search-association [class*=" icon-"] {
+ /* use !important to prevent issues with browser extensions that change fonts */
+ font-family: 'icomoon' !important;
+ speak: none;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+
+ /* Better Font Rendering =========== */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+}
+
+.search-input{
+ width:40px;
+ margin-left: -30px;
+ z-index: 2;
+ cursor: pointer;
+ display: inline-block;
+ position: absolute;
+ line-height: 40px;
+}
+.content-wrapper{
+ margin-left: 70px;
+ font-family: OpenSans-Semibold;
+ }
+.content-wrapper .content{
+ margin-top: 47px;
+}
+.input-wrapper{
+ margin-top: 6px;
+}
+input[type=search]{
+ /*border: none;*/
+ width: 415px;
+ height: 40px;
+ border: 1px solid #D2D2D2;
+ border-radius: 2px;
+}
+input[type=search]:before {
+/* content: "\e90d";
+ color: #00aeef;
+ font-size: 50px;
+ cursor: pointer;
+ margin-left: 350px*/
+}
+.error-msg{
+ color: red;
+}
+.bold{
+ font-family: OpenSans-Semibold;
+}
+.margin-search{
+ margin-top: 37px;
+}
+.result-content span{
+ font-family: OpenSans-Semibold;
+}
+.result-content div{
+ margin-bottom: 24px;
+ margin-top: 3px;
+}
+.search2-icon:before {
+ font-family: 'icomoon';
+ content: "\e90d";
+ color: #009FDB;
+ font-size: 17px;
+ cursor: pointer;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/search.css b/vid-app-common/src/main/webapp/app/vid/styles/search.css
new file mode 100644
index 000000000..8ab5ea8c0
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/search.css
@@ -0,0 +1,37 @@
+.search-container {
+ display: flex;
+ background: #FFFFFF;
+ border: 1px solid #D2D2D2;
+ border-radius: 2px;
+ width: 500px;
+}
+.search-container .search-input,
+.search-container .search-input:focus,
+.search-container .search-input:hover{
+ border: none;
+ padding: 10px;
+ display: inline-block;
+ width: 458px;
+ font-style: italic;
+}
+
+.search-container .search-input::placeholder {
+ text-align: left;
+}
+
+.search-container .search-icon {
+ display: inline-block;
+ margin: auto;
+ width: 16px;
+ height: 16px;
+}
+
+.search-container .search-icon svg path {
+ fill: #5A5A5A;
+}
+
+.search-container .search-icon:hover path {
+ fill: #009FDB;
+}
+
+
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css b/vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css
new file mode 100644
index 000000000..c54b6d4c9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/serviceMetadata.css
@@ -0,0 +1,18 @@
+service-metadata {
+ display: block;
+}
+service-metadata .header-title {
+ text-transform: uppercase;
+ font-size: 16px;
+ color: #191919;
+ background: #EAEAEA;
+ line-height: 40px;
+ padding-left: 20px;
+}
+service-metadata .metadata-content {
+ padding-left: 20px;
+}
+service-metadata .field {
+ margin-top: 15px;
+ font-size: 13px;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css b/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css
index 0a642993e..a8dddb6a4 100755
--- a/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/serviceModels.css
@@ -67,4 +67,8 @@ div[ng-controller=ServiceModelController] .progHidden {
div[ng-controller=ServiceModelController] .progVisible {
visibility: visible;
+}
+
+.previous-versions-button {
+ width: 113px;
} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css b/vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css
new file mode 100644
index 000000000..d1ca37bad
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/serviceProxyConfig.css
@@ -0,0 +1,154 @@
+.diagram {
+ background: #F8F8F8;
+ padding: 48px 20px;
+ margin: 0px 48px;
+ display: flex;
+ flex-direction: column;
+}
+.diagram .diagram-img {
+ margin: 0 auto;
+ display: flex;
+ width: 90%;
+}
+.circle {
+ float: left;
+ border: 3px solid;
+ width: 140px;
+ height: 140px;
+ border-radius: 50%;
+ flex: 0 0 140px;
+}
+.circle .text {
+ float: left;
+ width: 100%;
+ padding-top: 37%;
+ text-align: center;
+ font-size: 14px;
+ color: #191919;
+ line-height: 17px;
+}
+.config-circle {
+ border-color: #9063CD;
+ background-color: rgba(144,99,205,0.50);
+}
+.config-circle .line {
+ width: 3px;
+ background-color: #8f61cc;
+ margin: auto;
+ height: 100%;
+ display: block;
+}
+.service-circle {
+ border-color: #71C5E8;
+}
+.service-circle:hover {
+ background: rgba(113, 197, 232, 0.50);
+}
+.dotted-line {
+ border-bottom: 2px dashed #5a5a5a;
+ width: 200px;
+ float: left;
+ height: 70px;
+ flex: 1;
+}
+.dotted-line.unchecked .conn-circle {
+ width: 13px;
+ height: 13px;
+ margin: 54px auto;
+ display: block;
+ border: 15px solid #F8F8F8;
+}
+.dotted-line.unchecked .conn-circle:before {
+ content: "";
+ float: left;
+ background: #767676;
+ width: 13px;
+ height: 13px;
+ border-radius: 50%;
+ position: relative;
+ top: -6px;
+ right: 6px;
+}
+
+.valid-large {
+ background-position: -240px -154px;
+ width: 35px;
+ height: 35px;
+}
+.dotted-line.checked .conn-circle {
+ margin: 52px auto;
+ display: block;
+}
+.element-name {
+ color: #191919;
+ font-size: 14px;
+ width: 100%;
+ text-align: center;
+}
+.element-name.service {
+ flex: 50%;
+}
+.element-name-wrapper{
+ display: flex;
+ margin-top: 30px;
+}
+.element-name-wrapper .element-name .label-txt {
+ color: #191919;
+ font-size: 14px;
+}
+.element-name-wrapper .element-name.service .label-txt:hover {
+ color: #009FDB;
+ cursor: pointer;
+ text-align: center;
+}
+.element-name-wrapper .element-name .info{
+ background: #009FDB;
+ border-radius: 50%;
+ height: 16px;
+ width: 16px;
+ color: white;
+ line-height: 15px;
+ padding-top: 1px;
+ margin-left: 10px;
+ margin-top: 2px;
+ cursor: pointer;
+ display: inline-block;
+}
+.service-wrapper-config .bottom {
+ display: flex;
+ height: 450px;
+ margin: 40px 48px;
+}
+.service-wrapper-config .wrapper-list {
+ flex: 50%;
+ height: 100%;
+}
+.service-wrapper-config .wrapper-list:first-child {
+ border-right: 1px dashed #D8D8D8;
+ margin-right: 50px;
+ padding-right: 50px;
+}
+.service-wrapper-config .title-txt {
+ color: #191919;
+ font-size: 13px;
+ margin-bottom: 10px;
+}
+
+.service-wrapper-config .select-vnf-title {
+ margin-top: 20px;
+}
+
+.ng-hide-keep-block.ng-hide:not(.ng-hide-animate) {
+ display: block!important;
+ visibility: hidden;
+}
+
+.service-wrapper-config select {
+ border-color: #D2D2D2;
+ background-position: 100% 4px;
+}
+.no-results {
+ margin-top: 10px;
+ text-align: center;
+ display: block;
+} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css b/vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css
new file mode 100644
index 000000000..4532111b9
--- /dev/null
+++ b/vid-app-common/src/main/webapp/app/vid/styles/testEnvironments.css
@@ -0,0 +1,215 @@
+.body-content-jsp {
+ margin-top: 35px;
+ min-height: 500px;
+ margin-left: 201px;
+ margin-right: 0px;
+ background-color: #f8f8f8;
+ display: flex;
+ flex-direction: column;
+}
+
+.temporary-solution {
+ display: none;
+}
+
+.body-content-jsp > div.ng-scope {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.body-content-jsp > div.ng-scope > div {
+ flex: 1;
+ display: flex;
+ flex-direction: column;
+}
+
+.test-environments {
+ background: white;
+ font-family: "OpenSans-Regular";
+ color: #797979;
+ flex:1;
+ display: flex;
+ flex-direction: column;
+}
+
+.test-environments .header {
+ height: 70px;
+ padding: 15px;
+ background: #F8F8F8;
+}
+.test-environments .header .header-left {
+ display: inline-flex;
+ align-items: center;
+}
+
+.test-environments .headline {
+ color: #5A5A5A;
+ font-size: 22px;
+ text-align: left;
+}
+
+.test-environments .separator {
+ height: 40px;
+ border-left: 1px solid #D2D2D2;
+ margin: 0px 20px;
+}
+
+.test-environments .header .button-container {
+ display: flex;
+ align-items: center;
+ cursor: pointer;
+}
+
+.test-environments .error-messages {
+ margin: auto;
+}
+
+.test-environments .error-messages .no-data svg path {
+ fill: #D2D2D2;
+}
+
+.test-environments .error-messages .no-data .secondaryMessage,
+.test-environments .error-messages .connect-error .secondaryMessage {
+ color: #D2D2D2;
+}
+
+.test-environments .error-messages .connect-error svg path {
+ fill: red;
+}
+
+.test-environments .error-messages .connect-error .primaryMessage {
+ color: red;
+}
+
+.test-environments .button-container svg {
+ fill: #009FDB;
+}
+
+.test-environments .button-container .button-text{
+ color: #5A5A5A;
+ padding-left: 10px;
+}
+
+.test-environments .search-container {
+ float: right;
+ margin-right: 40px;
+}
+
+.test-environments .refresh:focus {
+ outline: none;
+}
+
+.test-environments .refresh {
+ float: right;
+ width: 20px;
+ height: 20px;
+ border: none;
+ background: none;
+ padding: 0;
+ margin-bottom: 15px;
+}
+
+.test-environments .refresh svg{
+ height: 20px;
+ width: 20px;
+}
+
+.test-environments .refresh svg path {
+ fill: #5A5A5A;
+}
+
+.test-environments .refresh:hover path {
+ fill: #009FDB;
+}
+
+.test-environments .error {
+ text-align: center;
+ color: red;
+}
+
+.test-environments .environments-table {
+ margin: 40px;
+}
+
+.test-environments .environments-table .tablesorter-default {
+ cursor: default;
+}
+
+.test-environments .environments-table .tablesorter-default thead .tablesorter-header .tablesorter-header-inner {
+ background-image: none;
+ background-size: 8px;
+}
+
+.test-environments .environments-table .tablesorter-default thead .tablesorter-headerAsc .tablesorter-header-inner {
+ background-image: url('../images/sort_down.svg');
+}
+
+.test-environments .environments-table .tablesorter-default thead .tablesorter-headerDesc .tablesorter-header-inner {
+ background-image: url('../images/sort_up.svg');
+}
+
+.test-environments .environments-table .thead-default tr th {
+ background: #EAEAEA;
+ color: #191919;
+ font-size: 13px;
+ font-weight: 600;
+ vertical-align: middle;
+}
+
+.test-environments .environments-table .thead-default tr th .tablesorter-header-inner {
+ padding-right: 10px;
+}
+
+.test-environments .environments-table .thead-default tr th span {
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.test-environments .environments-table .thead-default tr th:first-child {
+ min-width: 150px;
+}
+
+/*.test-environments .environments-table .thead-default tr th:*/
+
+.test-environments .environments-table .tablesorter-header-inner {
+ padding: 0;
+ width: 100%;
+}
+
+.test-environments .environments-table .tablesorter-default tbody td {
+ background: white;
+ font-size: 14px;
+ padding: 12px 8px;
+}
+
+.test-environments .environments-table .tablesorter-default tbody tr:focus td {
+ background: #E6F6FB;
+}
+
+.test-environments .environments-table .tablesorter-default tbody tr:focus {
+ border: none;
+ outline: none;
+}
+
+.attach-button {
+ margin-left: 35px;
+}
+
+.envActionBtn {
+ width: 94px;
+ height: 30px;
+}
+
+#environments-table {
+ margin-top: 0;
+}
+
+.test-environments-table-container {
+ overflow: auto;
+ max-height: 50vh;
+ width: 98%;
+ margin-left: 15px;
+ padding-left: 0;
+}
diff --git a/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css b/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css
index 1aec73d81..7904b3695 100755
--- a/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css
+++ b/vid-app-common/src/main/webapp/app/vid/styles/vidTree.css
@@ -64,4 +64,8 @@ tr.angular-ui-tree-empty {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
+}
+
+.pull-right .dropdown-menu {
+ background-color: transparent;
} \ No newline at end of file
diff --git a/vid-app-common/src/main/webapp/test.jsp b/vid-app-common/src/main/webapp/test.jsp
index 1b0c14a42..e13cd4b59 100755
--- a/vid-app-common/src/main/webapp/test.jsp
+++ b/vid-app-common/src/main/webapp/test.jsp
@@ -3,16 +3,16 @@
<!-- This is a temporary test page. It will be removed from source control -->
<body>
<%@ page import="org.openecomp.portalsdk.core.util.SystemProperties" %>
-<%@ page import="org.openecomp.vid.controller.MsoController" %>
-<%@ page import="org.openecomp.vid.mso.rest.Request" %>
-<%@ page import="org.openecomp.vid.mso.rest.RequestDetails" %>
-<%@ page import="org.openecomp.vid.mso.rest.RelatedModel" %>
-<%@ page import="org.openecomp.vid.domain.mso.SubscriberInfo" %>
-<%@ page import="org.openecomp.vid.domain.mso.Response" %>
-<%@ page import="org.openecomp.vid.domain.mso.ModelInfo" %>
-<%@ page import="org.openecomp.vid.domain.mso.RequestInfo" %>
-<%@ page import="org.openecomp.vid.domain.mso.CloudConfiguration" %>
-<%@ page import="org.openecomp.vid.mso.MsoProperties" %>
+<%@ page import="org.onap.vid.controller.MsoController" %>
+<%@ page import="org.onap.vid.mso.rest.Request" %>
+<%@ page import="org.onap.vid.mso.rest.RequestDetails" %>
+<%@ page import="org.onap.vid.mso.rest.RelatedModel" %>
+<%@ page import="org.onap.vid.domain.mso.SubscriberInfo" %>
+<%@ page import="org.onap.vid.domain.mso.Response" %>
+<%@ page import="org.onap.vid.domain.mso.ModelInfo" %>
+<%@ page import="org.onap.vid.domain.mso.RequestInfo" %>
+<%@ page import="org.onap.vid.domain.mso.CloudConfiguration" %>
+<%@ page import="org.onap.vid.mso.MsoProperties" %>
<%@ page import="java.net.URI" %>
<%@ page import="com.sun.jersey.api.client.ClientResponse" %>
<%