BUG-58: refactor to take advantage of netty
[bgpcep.git] / bgp / rib-impl / src / main / java / org / opendaylight / protocol / bgp / rib / impl / spi / BGPSessionPreferences.java
1 /*
2  * Copyright (c) 2013 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 package org.opendaylight.protocol.bgp.rib.impl.spi;
9
10 import java.util.List;
11
12 import org.opendaylight.protocol.bgp.parser.BGPParameter;
13 import org.opendaylight.protocol.concepts.ASNumber;
14 import org.opendaylight.protocol.concepts.IPv4Address;
15
16 /**
17  * DTO for BGP Session preferences, that contains BGP Open message.
18  */
19 public final class BGPSessionPreferences {
20
21         private final ASNumber as;
22
23         private final int hold;
24
25         private final IPv4Address bgpId;
26
27         private final List<BGPParameter> params;
28
29         /**
30          * Creates a new DTO for Open message.
31          * 
32          * @param prefs BGP Open message
33          */
34         public BGPSessionPreferences(final ASNumber as, final int hold, final IPv4Address bgpId, final List<BGPParameter> params) {
35                 this.as = as;
36                 this.hold = hold;
37                 this.bgpId = bgpId;
38                 this.params = params;
39         }
40
41         /**
42          * Returns my AS number.
43          * 
44          * @return AS number
45          */
46         public ASNumber getMyAs() {
47                 return this.as;
48         }
49
50         /**
51          * Returns initial value of HoldTimer.
52          * 
53          * @return initial value of HoldTimer
54          */
55         public int getHoldTime() {
56                 return this.hold;
57         }
58
59         /**
60          * Returns my BGP Identifier.
61          * 
62          * @return BGP identifier
63          */
64         public IPv4Address getBgpId() {
65                 return this.bgpId;
66         }
67
68         public List<BGPParameter> getParams() {
69                 return this.params;
70         }
71 }