blob: 4d0c266837b594cb6eb3777fdd91b4715ea0d574 [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;
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -07004import net.onrc.onos.core.topology.serializers.DeviceSerializer;
5import org.codehaus.jackson.map.annotate.JsonSerialize;
Jonathan Hart062a2e82014-02-03 09:41:57 -08006
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -08007/**
8 * Interface of Device Object exposed to the "NB" read-only Topology.
Ray Milkey269ffb92014-04-03 14:43:30 -07009 * <p/>
Yuta HIGUCHI8d9fddf2014-02-10 13:32:16 -080010 * TODO What a Device Object represent is unclear at the moment.
Ray Milkey269ffb92014-04-03 14:43:30 -070011 * <p/>
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080012 * Everything returned by these interfaces must be either Unmodifiable view,
13 * immutable object, or a copy of the original "SB" In-memory Topology.
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080014 */
Pavlin Radoslavov1cbfcae2014-05-23 17:28:08 -070015@JsonSerialize(using = DeviceSerializer.class)
Jonathan Hart062a2e82014-02-03 09:41:57 -080016public interface Device {
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080017 /**
18 * Get the device MAC address.
19 *
20 * @return the device MAC address.
21 */
22 public MACAddress getMacAddress();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080023
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080024 /**
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080025 * Get the device attachment points.
Ray Milkey269ffb92014-04-03 14:43:30 -070026 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080027 * Add requirement for Iteration order? Latest observed port first.
28 *
29 * @return the device attachment points.
30 */
31 public Iterable<Port> getAttachmentPoints();
Yuta HIGUCHI181d34d2014-02-05 15:05:46 -080032
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080033 /**
34 * Get the device last seen time.
Ray Milkey269ffb92014-04-03 14:43:30 -070035 * <p/>
Pavlin Radoslavov7c8f69a2014-02-19 19:01:45 -080036 * TODO: what is the time definition?
37 *
38 * @return the device last seen time.
39 */
40 public long getLastSeenTime();
Jonathan Hart062a2e82014-02-03 09:41:57 -080041}