2 * Copyright 2015 Open Networking Laboratory
4 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5 * the License. You may obtain a copy of the License at
7 * http://www.apache.org/licenses/LICENSE-2.0
9 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10 * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11 * specific language governing permissions and limitations under the License.
14 package org.onosproject.bgp.controller.impl;
16 import org.onosproject.bgp.controller.BgpId;
17 import org.onosproject.bgp.controller.BgpSessionInfo;
18 import org.onosproject.bgpio.protocol.BgpVersion;
19 import org.slf4j.Logger;
20 import org.slf4j.LoggerFactory;
23 * Class maintains BGP peer session info.
25 public class BgpSessionInfoImpl implements BgpSessionInfo {
27 protected final Logger log = LoggerFactory.getLogger(BgpSessionInfoImpl.class);
28 private BgpId remoteBgpId;
29 private BgpVersion remoteBgpVersion;
30 private long remoteBgpASNum;
31 private short remoteBgpholdTime;
32 private int remoteBgpIdentifier;
33 private short negotiatedholdTime;
34 private boolean isIbgpSession;
37 * Initialize session info.
39 *@param remoteBgpId remote peer id
40 *@param remoteBgpVersion remote peer version
41 *@param remoteBgpASNum remote peer AS number
42 *@param remoteBgpholdTime remote peer hold time
43 *@param remoteBgpIdentifier remote peer identifier
44 *@param negotiatedholdTime negotiated hold time
45 *@param isIbgpSession session type ibgp/ebgp
47 public BgpSessionInfoImpl(BgpId remoteBgpId, BgpVersion remoteBgpVersion, long remoteBgpASNum,
48 short remoteBgpholdTime, int remoteBgpIdentifier, short negotiatedholdTime,
49 boolean isIbgpSession) {
50 this.remoteBgpId = remoteBgpId;
51 this.remoteBgpVersion = remoteBgpVersion;
52 this.remoteBgpASNum = remoteBgpASNum;
53 this.remoteBgpholdTime = remoteBgpholdTime;
54 this.remoteBgpIdentifier = remoteBgpIdentifier;
55 this.negotiatedholdTime = negotiatedholdTime;
56 this.isIbgpSession = isIbgpSession;
60 public boolean isIbgpSession() {
65 public short negotiatedholdTime() {
66 return negotiatedholdTime;
70 public BgpId remoteBgpId() {
75 public BgpVersion remoteBgpVersion() {
76 return remoteBgpVersion;
80 public long remoteBgpASNum() {
81 return remoteBgpASNum;
85 public short remoteBgpHoldTime() {
86 return remoteBgpholdTime;
90 public int remoteBgpIdentifier() {
91 return remoteBgpIdentifier;