blob: 9c4833edefc8449504e88c24eed788c2f18e2db7 [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/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080028 * Add requirement for Iteration order? Latest observed port first.
29 *
30 * @return the device attachment points.
31 */
32 public Iterable<Port> getAttachmentPoints();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080033
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080034 /**
35 * Get the device last seen time.
Ray Milkey269ffb92014-04-03 14:43:30 -070036 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080037 * TODO: what is the time definition?
38 *
39 * @return the device last seen time.
40 */
41 public long getLastSeenTime();
Jonathan Hart062a2e82014-02-03 09:41:57 -080042}