Bug-4827: BGP Add-Path OpenConfig Support
[bgpcep.git] / bgp / openconfig-spi / src / main / java / org / opendaylight / protocol / bgp / openconfig / spi / pojo / BGPRibInstanceConfiguration.java
1 /*
2  * Copyright (c) 2015 Cisco Systems, Inc. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8
9 package org.opendaylight.protocol.bgp.openconfig.spi.pojo;
10
11 import com.google.common.base.Optional;
12 import com.google.common.base.Preconditions;
13 import java.util.List;
14 import java.util.Map;
15 import org.opendaylight.protocol.bgp.mode.api.PathSelectionMode;
16 import org.opendaylight.protocol.bgp.openconfig.spi.InstanceConfigurationIdentifier;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
18 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.rib.TablesKey;
21
22 /**
23  * POJO for holding BGP RIB module instance configuration
24  *
25  */
26 public final class BGPRibInstanceConfiguration extends AbstractInstanceConfiguration {
27
28     private final AsNumber localAs;
29     private final Ipv4Address bgpRibId;
30     private final Ipv4Address clusterId;
31     private final List<BgpTableType> tableTypes;
32     private final Map<TablesKey, PathSelectionMode> pathSelectionModes;
33
34     public BGPRibInstanceConfiguration(final InstanceConfigurationIdentifier identifier, final AsNumber localAs, final Ipv4Address bgpRibId,
35             final Ipv4Address clusterId, final List<BgpTableType> tableTypes, final Map<TablesKey, PathSelectionMode> pathSelectionModes) {
36         super(identifier);
37         this.pathSelectionModes = pathSelectionModes;
38         this.localAs = Preconditions.checkNotNull(localAs);
39         this.bgpRibId = Preconditions.checkNotNull(bgpRibId);
40         this.clusterId = clusterId;
41         this.tableTypes = Preconditions.checkNotNull(tableTypes);
42     }
43
44     public AsNumber getLocalAs() {
45         return localAs;
46     }
47
48     public Ipv4Address getBgpRibId() {
49         return bgpRibId;
50     }
51
52     public Optional<Ipv4Address> getClusterId() {
53         return Optional.fromNullable(clusterId);
54     }
55
56     public List<BgpTableType> getTableTypes() {
57         return tableTypes;
58     }
59
60     public Map<TablesKey, PathSelectionMode> getPathSelectionModes() {
61         return pathSelectionModes;
62     }
63
64 }