2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.components.distribution.engine;
23 import org.openecomp.sdc.be.model.ComponentInstance;
25 import java.util.List;
27 public class JsonContainerResourceInstance {
28 private String resourceInstanceName;
29 private String resourceName;
30 private String resourceVersion;
31 private String resourceType;
32 private String resourceUUID;
33 private String resourceInvariantUUID;
34 private String resourceCustomizationUUID;
35 private String category;
36 private String subcategory;
37 private List<ArtifactInfoImpl> artifacts;
39 public JsonContainerResourceInstance(ComponentInstance resourceInstance, String resourceType, List<ArtifactInfoImpl> artifacts) {
41 this.resourceInstanceName = resourceInstance.getName();
42 this.resourceName = resourceInstance.getComponentName();
43 this.resourceVersion = resourceInstance.getComponentVersion();
44 this.resourceType = resourceType;
45 this.resourceUUID = resourceInstance.getComponentUid();
46 this.artifacts = artifacts;
47 this.resourceCustomizationUUID = resourceInstance.getCustomizationUUID();
50 public JsonContainerResourceInstance(ComponentInstance resourceInstance, List<ArtifactInfoImpl> artifacts) {
52 this.resourceInstanceName = resourceInstance.getName();
53 this.resourceName = resourceInstance.getComponentName();
54 this.resourceVersion = resourceInstance.getComponentVersion();
55 if(resourceInstance.getOriginType() != null)
56 this.resourceType = resourceInstance.getOriginType().getValue();
57 this.resourceUUID = resourceInstance.getComponentUid();
58 this.artifacts = artifacts;
59 this.resourceCustomizationUUID = resourceInstance.getCustomizationUUID();
62 public String getResourceInstanceName() {
63 return resourceInstanceName;
66 public void setResourceInstanceName(String resourceInstanceName) {
67 this.resourceInstanceName = resourceInstanceName;
70 public String getResourceName() {
74 public void setResourceName(String resourceName) {
75 this.resourceName = resourceName;
78 public String getResourceVersion() {
79 return resourceVersion;
82 public void setResourceVersion(String resourceVersion) {
83 this.resourceVersion = resourceVersion;
86 public String getResoucreType() {
90 public void setResoucreType(String resoucreType) {
91 this.resourceType = resoucreType;
94 public String getResourceUUID() {
98 public void setResourceUUID(String resourceUUID) {
99 this.resourceUUID = resourceUUID;
102 public List<ArtifactInfoImpl> getArtifacts() {
106 public void setArtifacts(List<ArtifactInfoImpl> artifacts) {
107 this.artifacts = artifacts;
110 public String getResourceInvariantUUID() {
111 return resourceInvariantUUID;
114 public void setResourceInvariantUUID(String resourceInvariantUUID) {
115 this.resourceInvariantUUID = resourceInvariantUUID;
118 public String getResourceCustomizationUUID() {
119 return resourceCustomizationUUID;
122 public void setResourceCustomizationUUID(String customizationUUID) {
123 this.resourceCustomizationUUID = customizationUUID;
126 public String getCategory() {
130 public void setCategory(String category) {
131 this.category = category;
134 public String getSubcategory() {
138 public void setSubcategory(String subcategory) {
139 this.subcategory = subcategory;
143 public String toString() {
144 return "JsonContainerResourceInstance [resourceInstanceName=" + resourceInstanceName + ", resourceName=" + resourceName + ", resourceVersion=" + resourceVersion + ", resoucreType=" + resourceType + ", resourceUUID=" + resourceUUID
145 + ", resourceInvariantUUID=" + resourceInvariantUUID + ", resourceCustomizationUUID=" + resourceCustomizationUUID + ", category=" + category + ", subcategory=" + subcategory + ", artifacts=" + artifacts + "]";