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 lombok.AllArgsConstructor;
20 import lombok.NoArgsConstructor;
22 import java.util.HashMap;
24 import java.util.Map.Entry;
29 public class AriaParserResult {
30 private String description;
31 private Map<String, String> metadata;
33 private Group[] groups;
34 private Policy[] policies;
35 private Substitution substitution;
36 private Map<String, Input> inputs;
37 private Map<String, Output> outpus;
39 public Map<String, String> getMetadata() {
40 if (this.metadata == null) {
41 return new HashMap<>();
50 private String type_name;
51 private String template_name;
52 private Map<String, Property> properties;
53 private Interface[] interfaces;
54 private Artifact[] artifacts;
55 private Capability[] capabilities;
56 private Relationship[] relationships;
59 public class Artifact {
61 private String type_name;
62 private String source_path;
63 private String target_path;
64 private String repository_url;
65 private Credential repository_credential;
66 private Map<String, Property> properties;
69 public class Credential {
70 private String protocol;
71 private String token_type;
72 private Map<String, String> keys;
78 public class Capability {
80 private String type_name;
81 private Map<String, Property> properties;
85 public class Relationship {
86 private String target_node_id;
87 private String target_capability_name;
88 private String type_name;
89 private String template_name;
90 private Map<String, Property> properties;
91 private Interface[] source_interfaces;
92 private Interface[] target_interfaces;
98 public Map<String, Object> getPropertyAssignments() {
99 if (this.properties == null || this.properties.isEmpty()) {
100 return new HashMap<String, Object>();
103 Map<String, Object> ret = new HashMap<String, Object>();
104 for (Entry<String, Property> e : this.properties.entrySet()) {
105 ret.put(e.getKey(), e.getValue().getValue());
115 private String type_name;
116 private String template_name;
117 private Map<String, Property> properties;
118 private Interface[] interfaces;
119 private GroupPolicy[] policies;
120 private String[] member_node_ids;
123 public class GroupPolicy {
125 private String type_name;
126 private Map<String, Property> properties;
127 private Trigger[] triggers;
130 public class Trigger {
132 private String implementation;
133 private Map<String, Property> properties;
141 public class Policy {
143 private String type_name;
144 private Map<String, Property> properties;
145 private String[] target_node_ids;
146 private String[] target_group_ids;
150 public class Substitution {
151 private String node_type_name;
152 private Mapping[] requirement;
153 private Mapping[] capabilities;
156 public class Mapping {
157 private String mapped_name;
158 private String node_id;
166 private String type_name;
167 private Object value;
168 private String description;
172 public class Output {
173 private String type_name;
174 private Object value;
175 private String description;
182 private String type_name;
183 private Object value;
184 private String description;
190 private String type_name;
191 private Map<String, Property> inputs;
192 private Operation[] operation;
197 private String implementation;
198 private String[] dependencies;
199 private String executor;
200 private int max_retries;
201 private int retry_interval;
202 private Map<String, Property> inputs;