2 * Copyright 2016 ZTE Corporation.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package org.openo.commontosca.catalog.model.parser.yaml.aria.entity;
18 import java.util.HashMap;
20 import java.util.Map.Entry;
22 import lombok.AllArgsConstructor;
24 import lombok.NoArgsConstructor;
29 public class AriaParserResult {
30 private Issue[] issues;
31 private Instance instance = new Instance();
33 private String rawData;
34 // private Type[] types;
35 // private Model model;
38 // public class Type {
41 // public class Model {
46 private String message;
47 private String location;
49 private String column;
50 private String snippet;
51 private String exception;
55 public class Instance {
56 private String description;
57 private Map<String, String> metadata;
59 private Group[] groups;
60 private Policy[] policies;
61 private Substitution substitution;
62 private Map<String, Input> inputs;
63 private Map<String, Output> outpus;
65 public Map<String, String> getMetadata() {
66 if (this.metadata == null) {
67 return new HashMap<>();
76 private String type_name;
77 private String template_name;
78 private Map<String, Property> properties;
79 private Interface[] interfaces;
80 private Artifact[] artifacts;
81 private Capability[] capabilities;
82 private Relationship[] relationships;
85 public class Artifact {
87 private String type_name;
88 private String source_path;
89 private String target_path;
90 private String repository_url;
91 private Credential repository_credential;
92 private Map<String, Property> properties;
95 public class Credential {
96 private String protocol;
97 private String token_type;
98 private Map<String, String> keys;
104 public class Capability {
106 private String type_name;
107 private Map<String, Property> properties;
111 public class Relationship {
112 private String target_node_id;
113 private String target_capability_name;
114 private String type_name;
115 private String template_name;
116 private Map<String, Property> properties;
117 private Interface[] source_interfaces;
118 private Interface[] target_interfaces;
124 public Map<String, Object> getPropertyAssignments() {
125 if (this.properties == null || this.properties.isEmpty()) {
126 return new HashMap<String, Object>();
129 Map<String, Object> ret = new HashMap<String, Object>();
130 for (Entry<String, Property> e : this.properties.entrySet()) {
131 ret.put(e.getKey(), e.getValue().getValue());
141 private String type_name;
142 private String template_name;
143 private Map<String, Property> properties;
144 private Interface[] interfaces;
145 private GroupPolicy[] policies;
146 private String[] member_node_ids;
149 public class GroupPolicy {
151 private String type_name;
152 private Map<String, Property> properties;
153 private Trigger[] triggers;
156 public class Trigger {
158 private String implementation;
159 private Map<String, Property> properties;
167 public class Policy {
169 private String type_name;
170 private Map<String, Property> properties;
171 private String[] target_node_ids;
172 private String[] target_group_ids;
176 public class Substitution {
177 private String node_type_name;
178 private Mapping[] requirement;
179 private Mapping[] capabilities;
182 public class Mapping {
183 private String mapped_name;
184 private String node_id;
192 private String type_name;
193 private Object value;
194 private String description;
198 public class Output {
199 private String type_name;
200 private Object value;
201 private String description;
210 private String type_name;
211 private Object value;
212 private String description;
218 private String type_name;
219 private Map<String, Property> inputs;
220 private Operation[] operation;
225 private String implementation;
226 private String[] dependencies;
227 private String executor;
228 private int max_retries;
229 private int retry_interval;
230 private Map<String, Property> inputs;