blob: cf8c393732e093cf8cac7f1305c3b44b32834576 [file] [log] [blame]
Jonathan Hartdc7e76c2017-03-27 11:35:34 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2017-present Open Networking Foundation
Jonathan Hartdc7e76c2017-03-27 11:35:34 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package org.onosproject.routing.fpm;
18
19import org.onosproject.cluster.NodeId;
20
21/**
22 * Information about an FPM connection.
23 */
24public class FpmConnectionInfo {
25
26 private final NodeId connectedTo;
27 private final long connectTime;
28 private final FpmPeer peer;
29
30 /**
31 * Creates a new connection info.
32 *
33 * @param connectedTo ONOS node the FPM peer is connected to
34 * @param peer FPM peer
35 * @param connectTime time the connection was made
36 */
37 public FpmConnectionInfo(NodeId connectedTo, FpmPeer peer, long connectTime) {
38 this.connectedTo = connectedTo;
39 this.peer = peer;
40 this.connectTime = connectTime;
41 }
42
43 /**
44 * Returns the node the FPM peers is connected to.
45 *
46 * @return ONOS node
47 */
48 public NodeId connectedTo() {
49 return connectedTo;
50 }
51
52 /**
53 * Returns the FPM peer.
54 *
55 * @return FPM peer
56 */
57 public FpmPeer peer() {
58 return peer;
59 }
60
61 /**
62 * Returns the time the connection was made.
63 *
64 * @return connect time
65 */
66 public long connectTime() {
67 return connectTime;
68 }
69}