2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
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
8 package org.opendaylight.protocol.bgp.rib.impl.spi;
10 import java.util.List;
11 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.AsNumber;
12 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Ipv4Address;
13 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.message.rev130919.open.message.BgpParameters;
14 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.bgp.types.rev130919.BgpId;
17 * DTO for BGP Session preferences, that contains BGP Open message.
19 public final class BGPSessionPreferences {
21 private final AsNumber as;
23 private final int hold;
25 private final BgpId bgpId;
27 private final List<BgpParameters> params;
29 private final AsNumber remoteAs;
32 * Creates a new DTO for Open message.
34 * @param as local AS number
35 * @param hold preferred hold timer value, in seconds
36 * @param bgpId local BGP Identifier
37 * @param remoteAs expected remote As Number
38 * @param params list of advertised parameters
40 public BGPSessionPreferences(final AsNumber as, final int hold, final BgpId bgpId, final AsNumber remoteAs,
41 final List<BgpParameters> params) {
44 this.bgpId = (bgpId != null) ? new BgpId(bgpId) : null;
45 this.remoteAs = remoteAs;
50 * Returns my AS number.
54 public AsNumber getMyAs() {
59 * Returns initial value of HoldTimer.
61 * @return initial value of HoldTimer
63 public int getHoldTime() {
68 * Returns my BGP Identifier.
70 * @return BGP identifier
72 public BgpId getBgpId() {
77 * Returns expected remote AS number.
81 public AsNumber getExpectedRemoteAs() {
86 * Gets a list of advertised bgp parameters.
88 * @return a list of advertised bgp parameters
90 public List<BgpParameters> getParams() {