2 * Copyright 2016 [ZTE] and others.
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.
17 package org.openo.commontosca.catalog.model.parser.yaml.aria.entity;
19 import java.util.HashMap;
21 import java.util.Map.Entry;
23 import lombok.AllArgsConstructor;
25 import lombok.NoArgsConstructor;
30 public class AriaParserResult {
31 private String description;
32 private Map<String, String> metadata;
34 private Group[] groups;
35 private Policy[] policies;
36 private Substitution substitution;
37 private Map<String, Input> inputs;
38 private Map<String, Output> outpus;
44 private String type_name;
45 private String template_name;
46 private Map<String, Property> properties;
47 private Interface[] interfaces;
48 private Artifact[] artifacts;
49 private Capability[] capabilities;
50 private Relationship[] relationships;
53 public class Artifact {
55 private String type_name;
56 private String source_path;
57 private String target_path;
58 private String repository_url;
59 private Credential repository_credential;
60 private Map<String, Property> properties;
63 public class Credential {
64 private String protocol;
65 private String token_type;
66 private Map<String, String> keys;
72 public class Capability {
74 private String type_name;
75 private Map<String, Property> properties;
79 public class Relationship {
80 private String target_node_id;
81 private String target_capability_name;
82 private String type_name;
83 private String template_name;
84 private Map<String, Property> properties;
85 private Interface[] source_interfaces;
86 private Interface[] target_interfaces;
92 public Map<String, Object> getPropertyAssignments() {
93 if (this.properties == null || this.properties.isEmpty()) {
94 return new HashMap<String, Object>();
97 Map<String, Object> ret = new HashMap<String, Object>();
98 for (Entry<String, Property> e : this.properties.entrySet()) {
99 ret.put(e.getKey(), e.getValue().getValue());
109 private String type_name;
110 private String template_name;
111 private Map<String, Property> properties;
112 private Interface[] interfaces;
113 private GroupPolicy[] policies;
114 private String[] member_node_ids;
117 public class GroupPolicy {
119 private String type_name;
120 private Map<String, Property> properties;
121 private Trigger[] triggers;
124 public class Trigger {
126 private String implementation;
127 private Map<String, Property> properties;
135 public class Policy {
137 private String type_name;
138 private Map<String, Property> properties;
139 private String[] target_node_ids;
140 private String[] target_group_ids;
144 public class Substitution {
145 private String node_type_name;
146 private Mapping[] requirement;
147 private Mapping[] capabilities;
150 public class Mapping {
151 private String mapped_name;
152 private String node_id;
160 private String type_name;
161 private Object value;
162 private String description;
166 public class Output {
167 private String type_name;
168 private Object value;
169 private String description;
176 private String type_name;
177 private Object value;
178 private String description;
184 private String type_name;
185 private Map<String, Property> inputs;
186 private Operation[] operation;
191 private String implementation;
192 private String[] dependencies;
193 private String executor;
194 private int max_retries;
195 private int retry_interval;
196 private Map<String, Property> inputs;