blob: 9ae69f88fb717e7f46a59469c4d7a7ece2c3dc99 [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 Hart90a02c22015-02-13 11:52:07 -080016package org.onosproject.routing.config;
17
18import com.fasterxml.jackson.annotation.JsonProperty;
19import org.onosproject.routingapi.config.BgpPeer;
20import org.onosproject.routingapi.config.BgpSpeaker;
Jonathan Hartbac07a02014-10-13 21:29:54 -070021
22import java.util.Collections;
23import java.util.List;
24
Jonathan Hartbac07a02014-10-13 21:29:54 -070025/**
26 * Contains the configuration data for SDN-IP that has been read from a
27 * JSON-formatted configuration file.
28 */
29public class Configuration {
30 // We call the BGP routers in our SDN network the BGP speakers, and call
31 // the BGP routers outside our SDN network the BGP peers.
32 private List<BgpSpeaker> bgpSpeakers;
33 private List<BgpPeer> peers;
34
35 /**
36 * Default constructor.
37 */
38 public Configuration() {
39 }
40
41 /**
42 * Gets a list of bgpSpeakers in the system, represented by
43 * {@link BgpSpeaker} objects.
44 *
45 * @return the list of BGP speakers
46 */
47 public List<BgpSpeaker> getBgpSpeakers() {
48 return Collections.unmodifiableList(bgpSpeakers);
49 }
50
51 /**
52 * Sets a list of bgpSpeakers in the system.
53 *
54 * @param bgpSpeakers the list of BGP speakers
55 */
56 @JsonProperty("bgpSpeakers")
57 public void setBgpSpeakers(List<BgpSpeaker> bgpSpeakers) {
58 this.bgpSpeakers = bgpSpeakers;
59 }
60
61 /**
62 * Gets a list of BGP peers we are configured to peer with. Peers are
63 * represented by {@link BgpPeer} objects.
64 *
65 * @return the list of BGP peers
66 */
67 public List<BgpPeer> getPeers() {
68 return Collections.unmodifiableList(peers);
69 }
70
71 /**
72 * Sets a list of BGP peers we are configured to peer with.
73 *
74 * @param peers the list of BGP peers
75 */
76 @JsonProperty("bgpPeers")
77 public void setPeers(List<BgpPeer> peers) {
78 this.peers = peers;
79 }
80
81}