blob: 394a55a045055cd08f0901ffdb496648d8fb5679 [file] [log] [blame]
Thomas Vachuska781d18b2014-10-27 10:31:25 -07001/*
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07002 * Copyright 2014 Open Networking Laboratory
Thomas Vachuska781d18b2014-10-27 10:31:25 -07003 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07004 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
Thomas Vachuska781d18b2014-10-27 10:31:25 -07007 *
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07008 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
Thomas Vachuska781d18b2014-10-27 10:31:25 -070015 */
Jonathan Hartbac07a02014-10-13 21:29:54 -070016package org.onlab.onos.sdnip.config;
17
18import java.util.Collections;
19import java.util.List;
20
Jonathan Hartd7bd9822014-10-20 18:18:02 -070021import com.fasterxml.jackson.annotation.JsonProperty;
Jonathan Hartbac07a02014-10-13 21:29:54 -070022
23/**
24 * Contains the configuration data for SDN-IP that has been read from a
25 * JSON-formatted configuration file.
26 */
27public class Configuration {
28 // We call the BGP routers in our SDN network the BGP speakers, and call
29 // the BGP routers outside our SDN network the BGP peers.
30 private List<BgpSpeaker> bgpSpeakers;
31 private List<BgpPeer> peers;
32
33 /**
34 * Default constructor.
35 */
36 public Configuration() {
37 }
38
39 /**
40 * Gets a list of bgpSpeakers in the system, represented by
41 * {@link BgpSpeaker} objects.
42 *
43 * @return the list of BGP speakers
44 */
45 public List<BgpSpeaker> getBgpSpeakers() {
46 return Collections.unmodifiableList(bgpSpeakers);
47 }
48
49 /**
50 * Sets a list of bgpSpeakers in the system.
51 *
52 * @param bgpSpeakers the list of BGP speakers
53 */
54 @JsonProperty("bgpSpeakers")
55 public void setBgpSpeakers(List<BgpSpeaker> bgpSpeakers) {
56 this.bgpSpeakers = bgpSpeakers;
57 }
58
59 /**
60 * Gets a list of BGP peers we are configured to peer with. Peers are
61 * represented by {@link BgpPeer} objects.
62 *
63 * @return the list of BGP peers
64 */
65 public List<BgpPeer> getPeers() {
66 return Collections.unmodifiableList(peers);
67 }
68
69 /**
70 * Sets a list of BGP peers we are configured to peer with.
71 *
72 * @param peers the list of BGP peers
73 */
74 @JsonProperty("bgpPeers")
75 public void setPeers(List<BgpPeer> peers) {
76 this.peers = peers;
77 }
78
79}