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 | 2da1e60 | 2015-02-18 19:09:24 -0800 | [diff] [blame] | 16 | package org.onosproject.routing.config.impl; |
Jonathan Hart | 90a02c2 | 2015-02-13 11:52:07 -0800 | [diff] [blame] | 17 | |
| 18 | import com.fasterxml.jackson.annotation.JsonProperty; |
Jonathan Hart | 2da1e60 | 2015-02-18 19:09:24 -0800 | [diff] [blame] | 19 | import org.onosproject.routing.config.BgpPeer; |
| 20 | import org.onosproject.routing.config.BgpSpeaker; |
Jonathan Hart | bac07a0 | 2014-10-13 21:29:54 -0700 | [diff] [blame] | 21 | |
| 22 | import java.util.Collections; |
| 23 | import java.util.List; |
| 24 | |
Jonathan Hart | bac07a0 | 2014-10-13 21:29:54 -0700 | [diff] [blame] | 25 | /** |
| 26 | * Contains the configuration data for SDN-IP that has been read from a |
| 27 | * JSON-formatted configuration file. |
| 28 | */ |
| 29 | public 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 | } |