Update release name to "Honolulu" in "About" page
[ccsdk/features.git] / sdnr / wt / data-provider / provider / src / main / java / org / onap / ccsdk / features / sdnr / wt / dataprovider / http / about / ODLVersionLUT.java
1 /*
2  * ============LICENSE_START=======================================================
3  * ONAP : ccsdk features
4  * ================================================================================
5  * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property.
6  * All rights reserved.
7  * ================================================================================
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  *     http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  * ============LICENSE_END=========================================================
20  *
21  */
22 package org.onap.ccsdk.features.sdnr.wt.dataprovider.http.about;
23
24 import java.util.HashMap;
25 import java.util.Map;
26
27 public class ODLVersionLUT {
28
29     private static Map<String,String> odlMdsalVersionLUT=null;
30
31     public static String getONAPReleaseName(String onapCCSDKVersion, String def) {
32         if (onapCCSDKVersion == null) {
33             return def;
34         }
35         if (onapCCSDKVersion.startsWith("2.1.")) {
36             return "ONAP Honolulu";
37         }
38         if (onapCCSDKVersion.startsWith("2.0.")) {
39             return "ONAP Guilin";
40         }
41         if (onapCCSDKVersion.startsWith("1.5.")) {
42             return "ONAP Frankfurt";
43         }
44         if (onapCCSDKVersion.startsWith("1.4.")) {
45             return "ONAP El Alto";
46         }
47         if (onapCCSDKVersion.startsWith("1.3.")) {
48             return "ONAP El Alto";
49         }
50         if (onapCCSDKVersion.startsWith("1.2.")) {
51             return "ONAP Guilin";
52         }
53         return def;
54     }
55
56     public static String getOdlVersion(String mdsalVersion, String def) {
57
58         if (mdsalVersion == null) {
59             return def;
60         }
61         if(odlMdsalVersionLUT==null) {
62             odlMdsalVersionLUT = new HashMap<>();
63             odlMdsalVersionLUT.put("5.0.14","magnesium-SR2 (0.12.2)");
64             odlMdsalVersionLUT.put("5.0.10","magnesium-SR1 (0.12.1)");
65             odlMdsalVersionLUT.put("5.0.9","magnesium-SR0 (0.12.0)");
66             odlMdsalVersionLUT.put("4.0.17","sodium-SR4 (0.11.4)");
67             odlMdsalVersionLUT.put("4.0.14","sodium-SR3 (0.11.3)");
68             odlMdsalVersionLUT.put("4.0.11","sodium-SR2 (0.11.2)");
69             odlMdsalVersionLUT.put("4.0.6","sodium-SR1 (0.11.1)");
70             odlMdsalVersionLUT.put("4.0.4","sodium-SR0 (0.11.0)");
71             odlMdsalVersionLUT.put("3.0.13","neon-SR3 (0.10.3)");
72             odlMdsalVersionLUT.put("3.0.10","neon-SR2 (0.10.2)");
73             odlMdsalVersionLUT.put("3.0.8","neon-SR1 (0.10.1)");
74             odlMdsalVersionLUT.put("3.0.6","neon-SR0 (0.10.0)");
75         }
76
77         return odlMdsalVersionLUT.getOrDefault(mdsalVersion, def);
78     }
79 }