Thomas Vachuska | 781d18b | 2014-10-27 10:31:25 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Licensed to the Apache Software Foundation (ASF) under one |
| 3 | * or more contributor license agreements. See the NOTICE file |
| 4 | * distributed with this work for additional information |
| 5 | * regarding copyright ownership. The ASF licenses this file |
| 6 | * to you under the Apache License, Version 2.0 (the |
| 7 | * "License"); you may not use this file except in compliance |
| 8 | * with the License. You may obtain a copy of the License at |
| 9 | * |
| 10 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | * |
| 12 | * Unless required by applicable law or agreed to in writing, |
| 13 | * software distributed under the License is distributed on an |
| 14 | * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | * KIND, either express or implied. See the License for the |
| 16 | * specific language governing permissions and limitations |
| 17 | * under the License. |
| 18 | */ |
Jonathan Hart | bac07a0 | 2014-10-13 21:29:54 -0700 | [diff] [blame] | 19 | package org.onlab.onos.sdnip.config; |
| 20 | |
| 21 | import java.util.Collections; |
| 22 | import java.util.List; |
| 23 | |
Jonathan Hart | d7bd982 | 2014-10-20 18:18:02 -0700 | [diff] [blame] | 24 | import com.fasterxml.jackson.annotation.JsonProperty; |
Jonathan Hart | bac07a0 | 2014-10-13 21:29:54 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Contains the configuration data for SDN-IP that has been read from a |
| 28 | * JSON-formatted configuration file. |
| 29 | */ |
| 30 | public class Configuration { |
| 31 | // We call the BGP routers in our SDN network the BGP speakers, and call |
| 32 | // the BGP routers outside our SDN network the BGP peers. |
| 33 | private List<BgpSpeaker> bgpSpeakers; |
| 34 | private List<BgpPeer> peers; |
| 35 | |
| 36 | /** |
| 37 | * Default constructor. |
| 38 | */ |
| 39 | public Configuration() { |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Gets a list of bgpSpeakers in the system, represented by |
| 44 | * {@link BgpSpeaker} objects. |
| 45 | * |
| 46 | * @return the list of BGP speakers |
| 47 | */ |
| 48 | public List<BgpSpeaker> getBgpSpeakers() { |
| 49 | return Collections.unmodifiableList(bgpSpeakers); |
| 50 | } |
| 51 | |
| 52 | /** |
| 53 | * Sets a list of bgpSpeakers in the system. |
| 54 | * |
| 55 | * @param bgpSpeakers the list of BGP speakers |
| 56 | */ |
| 57 | @JsonProperty("bgpSpeakers") |
| 58 | public void setBgpSpeakers(List<BgpSpeaker> bgpSpeakers) { |
| 59 | this.bgpSpeakers = bgpSpeakers; |
| 60 | } |
| 61 | |
| 62 | /** |
| 63 | * Gets a list of BGP peers we are configured to peer with. Peers are |
| 64 | * represented by {@link BgpPeer} objects. |
| 65 | * |
| 66 | * @return the list of BGP peers |
| 67 | */ |
| 68 | public List<BgpPeer> getPeers() { |
| 69 | return Collections.unmodifiableList(peers); |
| 70 | } |
| 71 | |
| 72 | /** |
| 73 | * Sets a list of BGP peers we are configured to peer with. |
| 74 | * |
| 75 | * @param peers the list of BGP peers |
| 76 | */ |
| 77 | @JsonProperty("bgpPeers") |
| 78 | public void setPeers(List<BgpPeer> peers) { |
| 79 | this.peers = peers; |
| 80 | } |
| 81 | |
| 82 | } |