blob: a3eaf8b0aba51ce4d2c1c05c6df5ad70cc0a1129 [file] [log] [blame]
Jonathan Hart472062d2014-04-03 10:56:48 -07001package net.onrc.onos.core.topology;
Jonathan Hart062a2e82014-02-03 09:41:57 -08002
Jonathan Hart062a2e82014-02-03 09:41:57 -08003import net.floodlightcontroller.util.MACAddress;
Yuta HIGUCHIa7f1cdd2014-06-09 15:05:20 -07004import net.onrc.onos.core.topology.web.serializers.DeviceSerializer;
5
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -07006import org.codehaus.jackson.map.annotate.JsonSerialize;
Jonathan Hart062a2e82014-02-03 09:41:57 -08007
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08008/**
9 * Interface of Device Object exposed to the "NB" read-only Topology.
Ray Milkey269ffb92014-04-03 14:43:30 -070010 * <p/>
Yuta HIGUCHI8d9fddf2014-02-10 13:32:16 -080011 * TODO What a Device Object represent is unclear at the moment.
Ray Milkey269ffb92014-04-03 14:43:30 -070012 * <p/>
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080013 * Everything returned by these interfaces must be either Unmodifiable view,
14 * immutable object, or a copy of the original "SB" In-memory Topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080015 */
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -070016@JsonSerialize(using = DeviceSerializer.class)
Jonathan Hart062a2e82014-02-03 09:41:57 -080017public interface Device {
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080018 /**
19 * Get the device MAC address.
20 *
21 * @return the device MAC address.
22 */
23 public MACAddress getMacAddress();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080024
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080025 /**
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080026 * Get the device attachment points.
Ray Milkey269ffb92014-04-03 14:43:30 -070027 * <p/>
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -070028 * TODO: There is only 1 attachment point right now.
29 * TODO: Add requirement for Iteration order? Latest observed port first.
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080030 *
31 * @return the device attachment points.
32 */
33 public Iterable<Port> getAttachmentPoints();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080034
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080035 /**
36 * Get the device last seen time.
Ray Milkey269ffb92014-04-03 14:43:30 -070037 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080038 *
Yuta HIGUCHIbf0a8712014-06-30 18:59:46 -070039 * @return the device last seen time. (UTC in ms)
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080040 */
41 public long getLastSeenTime();
Jonathan Hart062a2e82014-02-03 09:41:57 -080042}