Replaced all tabs with spaces in java and pom.xml
[so.git] / adapters / mso-catalog-db-adapter / src / main / java / db / migration / CloudConfig.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP - SO
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
10  * 
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  * 
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=========================================================
19  */
20
21 package db.migration;
22
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;
28 import java.util.HashMap;
29 import java.util.Map;
30
31 /**
32  * @deprecated This class is introduced as deprecated as its only purpose is for migration of cloud config data. It
33  *             shouldnt be used elsewhere.
34  */
35
36 @Deprecated
37 @JsonIgnoreProperties(ignoreUnknown = true)
38 public class CloudConfig {
39     @JsonProperty("identity_services")
40     private Map<String, CloudIdentity> identityServices = new HashMap<>();
41
42     @JsonProperty("cloud_sites")
43     private Map<String, CloudSite> cloudSites = new HashMap<>();
44
45     @JsonProperty("cloudify_managers")
46     private Map<String, CloudifyManager> cloudifyManagers = new HashMap<>();
47
48
49     public Map<String, CloudIdentity> getIdentityServices() {
50         return identityServices;
51     }
52
53     public void setIdentityServices(Map<String, CloudIdentity> identityServices) {
54         this.identityServices = identityServices;
55     }
56
57     public Map<String, CloudSite> getCloudSites() {
58         return cloudSites;
59     }
60
61     public void setCloudSites(Map<String, CloudSite> cloudSites) {
62         this.cloudSites = cloudSites;
63     }
64
65     public Map<String, CloudifyManager> getCloudifyManagers() {
66         return cloudifyManagers;
67     }
68
69     public void setCloudifyManagers(Map<String, CloudifyManager> cloudifyManagers) {
70         this.cloudifyManagers = cloudifyManagers;
71     }
72
73     public void populateId() {
74         for (Map.Entry<String, CloudIdentity> entry : identityServices.entrySet()) {
75             entry.getValue().setId(entry.getKey());
76         }
77
78         for (Map.Entry<String, CloudSite> entry : cloudSites.entrySet()) {
79             entry.getValue().setId(entry.getKey());
80         }
81
82         for (Map.Entry<String, CloudifyManager> entry : cloudifyManagers.entrySet()) {
83             entry.getValue().setId(entry.getKey());
84         }
85     }
86 }