Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 2 | * Copyright 2014 Open Networking Laboratory |
Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 3 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 4 | * 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 Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 7 | * |
Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 8 | * 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 Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 15 | */ |
Jonathan Hart | bac07a0 | 2014-10-13 21:29:54 -0700 | [diff] [blame] | 16 | package org.onlab.onos.sdnip.config; |
| 17 | |
| 18 | import java.util.Collections; |
| 19 | import java.util.List; |
| 20 | |
Jonathan Hart | d7bd982 | 2014-10-20 18:18:02 -0700 | [diff] [blame] | 21 | import com.fasterxml.jackson.annotation.JsonProperty; |
Jonathan Hart | bac07a0 | 2014-10-13 21:29:54 -0700 | [diff] [blame] | 22 | |
| 23 | /** |
| 24 | * Contains the configuration data for SDN-IP that has been read from a |
| 25 | * JSON-formatted configuration file. |
| 26 | */ |
| 27 | public 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 | } |