f39f2001f06dbd98dc2d651e3133ae5c71f42984
[portal/ric-dashboard.git] / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / config / RICInstanceConfiguration.java
1 /*-
2  * ========================LICENSE_START=================================
3  * O-RAN-SC
4  * %%
5  * Copyright (C) 2019 AT&T Intellectual Property
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 org.oransc.ric.portal.dashboard.config;
22
23 import java.util.ArrayList;
24 import java.util.List;
25
26 import org.oransc.ric.portal.dashboard.model.InstanceTransport;
27 import org.springframework.boot.context.properties.ConfigurationProperties;
28 import org.springframework.context.annotation.Configuration;
29
30 /**
31  * Holds the list of RIC instances read from configuration data. This asserts no
32  * Spring profile such as ("!test"). No mock version of this class is required.
33  * Populated from a YAML list in the application properties like this:
34  * 
35  * <pre>
36  * ric-instance-list:
37     instances:
38         -
39           key: key1
40           name: Friendly Name One
41         -
42           key: key2
43           name: Friendly Name Two
44  * </pre>
45  */
46 @Configuration
47 @ConfigurationProperties(prefix = "ric-instance-list")
48 public class RICInstanceConfiguration {
49         private List<InstanceTransport> instances = new ArrayList<>();
50
51         public List<InstanceTransport> getInstances() {
52                 return instances;
53         }
54
55         public void setInstances(List<InstanceTransport> instances) {
56                 this.instances = instances;
57         }
58 }