Merge "BUG-99: cleanup packages"
[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.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev100924.Ipv4Address;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130918.open.BgpParameters;
14
15 /**
16  * DTO for BGP Session preferences, that contains BGP Open message.
17  */
18 public final class BGPSessionPreferences {
19
20         private final int as;
21
22         private final int hold;
23
24         private final Ipv4Address bgpId;
25
26         private final List<BgpParameters> params;
27
28         /**
29          * Creates a new DTO for Open message.
30          * 
31          * @param prefs BGP Open message
32          */
33         public BGPSessionPreferences(final int as, final int hold, final Ipv4Address bgpId, final List<BgpParameters> params) {
34                 this.as = as;
35                 this.hold = hold;
36                 this.bgpId = bgpId;
37                 this.params = params;
38         }
39
40         /**
41          * Returns my AS number.
42          * 
43          * @return AS number
44          */
45         public int getMyAs() {
46                 return this.as;
47         }
48
49         /**
50          * Returns initial value of HoldTimer.
51          * 
52          * @return initial value of HoldTimer
53          */
54         public int getHoldTime() {
55                 return this.hold;
56         }
57
58         /**
59          * Returns my BGP Identifier.
60          * 
61          * @return BGP identifier
62          */
63         public Ipv4Address getBgpId() {
64                 return this.bgpId;
65         }
66
67         public List<BgpParameters> getParams() {
68                 return this.params;
69         }
70 }