BUG-4692: Migrate TCP-MD5 support in bgp package to netty's native-epoll
[bgpcep.git] / bgp / openconfig-spi / src / main / java / org / opendaylight / protocol / bgp / openconfig / spi / pojo / BGPPeerInstanceConfiguration.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 org.opendaylight.protocol.bgp.openconfig.spi.InstanceConfigurationIdentifier;
15 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
16 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
17 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.PortNumber;
18 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.BgpTableType;
19 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.multiprotocol.rev130919.mp.capabilities.add.path.capability.AddressFamilies;
20 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.rib.rev130925.PeerRole;
21 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.controller.rfc2385.cfg.rev160324.Rfc2385Key;
22
23 /**
24  * POJO for holding BGP Peer module instance configuration
25  *
26  */
27 public final class BGPPeerInstanceConfiguration extends AbstractInstanceConfiguration {
28
29     private final IpAddress host;
30     private final PortNumber port;
31     private final int holdTimer;
32     private final PeerRole peerRole;
33     private final boolean active;
34     private final List<BgpTableType> advertizedTables;
35     private final AsNumber asNumber;
36     private final Optional<Rfc2385Key> password;
37     private final List<AddressFamilies> addPathCapabilities;
38
39     public BGPPeerInstanceConfiguration(final InstanceConfigurationIdentifier identifier, final IpAddress host, final PortNumber port, final int holdTimer, final PeerRole peerRole,
40             final boolean active, final List<BgpTableType> advertizedTables, final AsNumber asNumber, final Optional<Rfc2385Key> password,
41             final List<AddressFamilies> addPathCapabilities) {
42         super(identifier);
43         this.addPathCapabilities = addPathCapabilities;
44         this.host = Preconditions.checkNotNull(host);
45         this.port = Preconditions.checkNotNull(port);
46         this.holdTimer = Preconditions.checkNotNull(holdTimer);
47         this.peerRole = Preconditions.checkNotNull(peerRole);
48         this.active = Preconditions.checkNotNull(active);
49         this.advertizedTables = Preconditions.checkNotNull(advertizedTables);
50         this.asNumber = Preconditions.checkNotNull(asNumber);
51         this.password = Preconditions.checkNotNull(password);
52     }
53
54     public IpAddress getHost() {
55         return host;
56     }
57
58     public PortNumber getPort() {
59         return port;
60     }
61
62     public int getHoldTimer() {
63         return holdTimer;
64     }
65
66     public PeerRole getPeerRole() {
67         return peerRole;
68     }
69
70     public boolean isActive() {
71         return active;
72     }
73
74     public List<BgpTableType> getAdvertizedTables() {
75         return advertizedTables;
76     }
77
78     public AsNumber getAsNumber() {
79         return asNumber;
80     }
81
82     public Optional<Rfc2385Key> getPassword() {
83         return password;
84     }
85
86     public List<AddressFamilies> getAddPathCapabilities() {
87         return addPathCapabilities;
88     }
89
90 }