blob: 76e2312919a19dbf0b39a22be81d75ffb5946ae2 [file] [log] [blame]
tomb36046e2014-08-27 00:22:24 -07001package org.onlab.onos.net;
2
3/**
4 * Representation of a network edge location where an end-station host is
5 * connected.
6 */
tombb58c202014-09-07 22:51:50 -07007public class HostLocation extends ConnectPoint {
8
toma56d5fe2014-09-17 11:05:47 -07009 // Note that time is explicitly excluded from the notion of equality.
tombb58c202014-09-07 22:51:50 -070010 private final long time;
11
tomf5d85d42014-10-02 05:27:56 -070012 /**
13 * Creates a new host location using the supplied device & port.
14 *
15 * @param deviceId device identity
16 * @param portNumber device port number
17 * @param time time when detected, in millis since start of epoch
18 */
tombb58c202014-09-07 22:51:50 -070019 public HostLocation(DeviceId deviceId, PortNumber portNumber, long time) {
20 super(deviceId, portNumber);
21 this.time = time;
22 }
tomb36046e2014-08-27 00:22:24 -070023
24 /**
tomf5d85d42014-10-02 05:27:56 -070025 * Returns the time when the location was established, given in
tomb36046e2014-08-27 00:22:24 -070026 * milliseconds since start of epoch.
27 *
tomf5d85d42014-10-02 05:27:56 -070028 * @return time in milliseconds since start of epoch
tomb36046e2014-08-27 00:22:24 -070029 */
tombb58c202014-09-07 22:51:50 -070030 public long time() {
31 return time;
32 }
33
tomb36046e2014-08-27 00:22:24 -070034}