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 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;
43 private String type_name;
44 private String template_name;
45 private Map<String, Property> properties;
46 private Interface[] interfaces;
47 private Artifact[] artifacts;
48 private Capability[] capabilities;
49 private Relationship[] relationships;
52 public class Artifact {
54 private String type_name;
55 private String source_path;
56 private String target_path;
57 private String repository_url;
58 private Credential repository_credential;
59 private Map<String, Property> properties;
62 public class Credential {
63 private String protocol;
64 private String token_type;
65 private Map<String, String> keys;
71 public class Capability {
73 private String type_name;
74 private Map<String, Property> properties;
78 public class Relationship {
79 private String target_node_id;
80 private String target_capability_name;
81 private String type_name;
82 private String template_name;
83 private Map<String, Property> properties;
84 private Interface[] source_interfaces;
85 private Interface[] target_interfaces;
91 public Map<String, Object> getPropertyAssignments() {
92 if (this.properties == null || this.properties.isEmpty()) {
93 return new HashMap<String, Object>();
96 Map<String, Object> ret = new HashMap<String, Object>();
97 for (Entry<String, Property> e : this.properties.entrySet()) {
98 ret.put(e.getKey(), e.getValue().getValue());
108 private String type_name;
109 private String template_name;
110 private Map<String, Property> properties;
111 private Interface[] interfaces;
112 private GroupPolicy[] policies;
113 private String[] member_node_ids;
116 public class GroupPolicy {
118 private String type_name;
119 private Map<String, Property> properties;
120 private Trigger[] triggers;
123 public class Trigger {
125 private String implementation;
126 private Map<String, Property> properties;
134 public class Policy {
136 private String type_name;
137 private Map<String, Property> properties;
138 private String[] target_node_ids;
139 private String[] target_group_ids;
143 public class Substitution {
144 private String node_type_name;
145 private Mapping[] requirement;
146 private Mapping[] capabilities;
149 public class Mapping {
150 private String mapped_name;
151 private String node_id;
159 private String type_name;
160 private Object value;
161 private String description;
165 public class Output {
166 private String type_name;
167 private Object value;
168 private String description;
175 private String type_name;
176 private Object value;
177 private String description;
183 private String type_name;
184 private Map<String, Property> inputs;
185 private Operation[] operation;
190 private String implementation;
191 private String[] dependencies;
192 private String executor;
193 private int max_retries;
194 private int retry_interval;
195 private Map<String, Property> inputs;