2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 * ============LICENSE_END=========================================================
18 package org.onap.dcae.genprocessor;
21 import java.net.URISyntaxException;
22 import java.util.List;
24 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
25 import com.fasterxml.jackson.annotation.JsonProperty;
27 import org.slf4j.Logger;
28 import org.slf4j.LoggerFactory;
30 @JsonIgnoreProperties(ignoreUnknown = true)
31 public class CompList {
33 static final Logger LOG = LoggerFactory.getLogger(CompList.class);
35 @JsonIgnoreProperties(ignoreUnknown = true)
36 public static class CompShort {
41 @JsonProperty("version")
42 public String version;
43 @JsonProperty("description")
44 public String description;
45 @JsonProperty("componentType")
46 public String componentType;
47 @JsonProperty("owner")
49 @JsonProperty("componentUrl")
50 public String componentUrl;
51 @JsonProperty("whenAdded")
52 public String whenAdded;
54 public String getNameForJavaClass() {
55 return Utils.formatNameForJavaClass(this.name);
58 public URI getComponentUrlAsURI() {
60 return new URI(this.componentUrl);
61 } catch (URISyntaxException e) {
62 throw new RuntimeException("Component URL is bad");
67 @JsonProperty("components")
68 public List<CompShort> components;