2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
23 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
24 import com.fasterxml.jackson.annotation.JsonProperty;
25 import org.onap.so.db.catalog.beans.CloudIdentity;
26 import org.onap.so.db.catalog.beans.CloudSite;
27 import org.onap.so.db.catalog.beans.CloudifyManager;
29 import java.util.HashMap;
34 * This class is introduced as deprecated as its only purpose is for migration of cloud config data. It shouldnt be used elsewhere.
38 @JsonIgnoreProperties(ignoreUnknown = true)
39 public class CloudConfig {
40 @JsonProperty("identity_services")
41 private Map<String, CloudIdentity> identityServices = new HashMap<>();
43 @JsonProperty("cloud_sites")
44 private Map<String, CloudSite> cloudSites = new HashMap<>();
46 @JsonProperty("cloudify_managers")
47 private Map<String, CloudifyManager> cloudifyManagers = new HashMap<>();
50 public Map<String, CloudIdentity> getIdentityServices() {
51 return identityServices;
54 public void setIdentityServices(Map<String, CloudIdentity> identityServices) {
55 this.identityServices = identityServices;
58 public Map<String, CloudSite> getCloudSites() {
62 public void setCloudSites(Map<String, CloudSite> cloudSites) {
63 this.cloudSites = cloudSites;
66 public Map<String, CloudifyManager> getCloudifyManagers() {
67 return cloudifyManagers;
70 public void setCloudifyManagers(Map<String, CloudifyManager> cloudifyManagers) {
71 this.cloudifyManagers = cloudifyManagers;
74 public void populateId(){
75 for (Map.Entry<String, CloudIdentity> entry : identityServices.entrySet()) {
76 entry.getValue().setId(entry.getKey());
79 for (Map.Entry <String, CloudSite> entry : cloudSites.entrySet()) {
80 entry.getValue().setId(entry.getKey());
83 for (Map.Entry<String, CloudifyManager> entry : cloudifyManagers.entrySet()) {
84 entry.getValue().setId(entry.getKey());