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.onap.so.asdc.client.test.emulators;
23 import java.util.ArrayList;
24 import java.util.List;
26 import org.onap.sdc.api.notification.IArtifactInfo;
27 import org.onap.sdc.api.notification.IResourceInstance;
29 public class ResourceInfoImpl implements IResourceInstance{
31 private String resourceInstanceName;
32 private String resourceCustomizationUUID;
33 private String resourceName;
34 private String resourceVersion;
35 private String resourceType;
36 private String resourceUUID;
37 private String resourceInvariantUUID;
38 private String category;
39 private String subcategory;
40 private List<ArtifactInfoImpl> artifacts;
42 private ResourceInfoImpl(IResourceInstance resourceInstance){
43 resourceInstanceName = resourceInstance.getResourceInstanceName();
44 resourceCustomizationUUID = resourceInstance.getResourceCustomizationUUID();
45 resourceName = resourceInstance.getResourceName();
46 resourceVersion = resourceInstance.getResourceVersion();
47 resourceType = resourceInstance.getResourceType();
48 resourceUUID = resourceInstance.getResourceUUID();
49 resourceInvariantUUID = resourceInstance.getResourceInvariantUUID();
50 category = resourceInstance.getCategory();
51 subcategory = resourceInstance.getSubcategory();
52 artifacts = ArtifactInfoImpl.convertToArtifactInfoImpl(resourceInstance.getArtifacts());
55 public static List<ResourceInfoImpl> convertToJsonContainer(List<IResourceInstance> resources){
56 List<ResourceInfoImpl> buildResources = new ArrayList<ResourceInfoImpl>();
57 if( resources != null ){
58 for( IResourceInstance resourceInstance : resources ){
59 buildResources.add(new ResourceInfoImpl(resourceInstance));
62 return buildResources;
66 public String getResourceInstanceName() {
67 return resourceInstanceName;
70 public void setResourceInstanceName(String resourceInstanceName) {
71 this.resourceInstanceName = resourceInstanceName;
75 public String getResourceName() {
79 public void setResourceName(String resourceName) {
80 this.resourceName = resourceName;
84 public String getResourceVersion() {
85 return resourceVersion;
88 public void setResourceVersion(String resourceVersion) {
89 this.resourceVersion = resourceVersion;
93 public String getResourceType() {
97 public void setResoucreType(String resourceType) {
98 this.resourceType = resourceType;
102 public String getResourceUUID() {
106 public void setResourceUUID(String resourceUUID) {
107 this.resourceUUID = resourceUUID;
111 public List<IArtifactInfo> getArtifacts() {
112 List<IArtifactInfo> temp = new ArrayList<IArtifactInfo>();
113 if( artifacts != null ){
114 temp.addAll(artifacts);
119 public void setArtifacts(List<ArtifactInfoImpl> artifacts) {
120 this.artifacts = artifacts;
123 public List<ArtifactInfoImpl> getArtifactsImpl(){
128 public String getResourceInvariantUUID() {
129 return resourceInvariantUUID;
132 public void setResourceInvariantUUID(String resourceInvariantUUID) {
133 this.resourceInvariantUUID = resourceInvariantUUID;
135 public String getResourceCustomizationUUID() {
136 return resourceCustomizationUUID;
139 public void setResourceCustomizationUUID(String resourceCustomizationUUID) {
140 this.resourceCustomizationUUID = resourceCustomizationUUID;
143 public String getCategory() {
147 public void setCategory(String category) {
148 this.category = category;
151 public String getSubcategory() {
155 public void setSubcategory(String subcategory) {
156 this.subcategory = subcategory;