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.mso.global_tests.asdc.notif_emulator;
23 import java.util.HashMap;
24 import java.util.List;
27 import org.codehaus.jackson.annotate.JsonAnySetter;
28 import org.codehaus.jackson.annotate.JsonIgnore;
29 import org.codehaus.jackson.annotate.JsonProperty;
30 import org.codehaus.jackson.map.annotate.JsonDeserialize;
32 import org.openecomp.sdc.api.notification.IArtifactInfo;
33 import org.openecomp.sdc.api.notification.IResourceInstance;
35 public class JsonResourceInfo implements IResourceInstance {
38 private Map<String,Object> attributesMap = new HashMap<>();
40 @JsonProperty("artifacts")
41 @JsonDeserialize(using=JsonArtifactInfoDeserializer.class)
42 private List<IArtifactInfo> artifacts;
44 public JsonResourceInfo() {
49 public List<IArtifactInfo> getArtifacts() {
54 public String getResourceInstanceName() {
55 return (String)attributesMap.get("resourceInstanceName");
59 public String getResourceInvariantUUID() {
60 return (String)attributesMap.get("resourceInvariantUUID");
64 public String getResourceName() {
65 return (String)attributesMap.get("resourceName");
69 public String getResourceType() {
70 return (String)attributesMap.get("resourceType");
74 public String getResourceUUID() {
75 return (String)attributesMap.get("resourceUUID");
79 public String getResourceVersion() {
80 return (String)attributesMap.get("resourceVersion");
84 public String getResourceCustomizationUUID() {
85 return (String)attributesMap.get("resourceCustomizationUUID");
89 public String getSubcategory() {
90 return (String)attributesMap.get("subCategory");
94 public String getCategory() {
95 return (String)attributesMap.get("category");
98 @SuppressWarnings("unused")
100 public final void setAttribute(String attrName, Object attrValue) {
101 if ((null != attrName) && (!attrName.isEmpty()) && (null != attrValue) && (null != attrValue.toString())) {
102 this.attributesMap.put(attrName,attrValue);