Jonathan Hart | 472062d | 2014-04-03 10:56:48 -0700 | [diff] [blame] | 1 | package net.onrc.onos.core.topology; |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 2 | |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 3 | import net.floodlightcontroller.util.MACAddress; |
Yuta HIGUCHI | a7f1cdd | 2014-06-09 15:05:20 -0700 | [diff] [blame] | 4 | import net.onrc.onos.core.topology.web.serializers.DeviceSerializer; |
| 5 | |
Pavlin Radoslavov | 1cbfcae | 2014-05-23 17:28:08 -0700 | [diff] [blame] | 6 | import org.codehaus.jackson.map.annotate.JsonSerialize; |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 7 | |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 8 | /** |
| 9 | * Interface of Device Object exposed to the "NB" read-only Topology. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 10 | * <p/> |
Yuta HIGUCHI | 8d9fddf | 2014-02-10 13:32:16 -0800 | [diff] [blame] | 11 | * TODO What a Device Object represent is unclear at the moment. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 12 | * <p/> |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 13 | * Everything returned by these interfaces must be either Unmodifiable view, |
| 14 | * immutable object, or a copy of the original "SB" In-memory Topology. |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 15 | */ |
Pavlin Radoslavov | 1cbfcae | 2014-05-23 17:28:08 -0700 | [diff] [blame] | 16 | @JsonSerialize(using = DeviceSerializer.class) |
Yuta HIGUCHI | 692e68e | 2014-07-09 18:08:02 -0700 | [diff] [blame] | 17 | public interface Device extends ITopologyElement { |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 18 | /** |
| 19 | * Get the device MAC address. |
| 20 | * |
| 21 | * @return the device MAC address. |
| 22 | */ |
| 23 | public MACAddress getMacAddress(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 24 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 25 | /** |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 26 | * Get the device attachment points. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 27 | * <p/> |
Yuta HIGUCHI | bf0a871 | 2014-06-30 18:59:46 -0700 | [diff] [blame] | 28 | * TODO: There is only 1 attachment point right now. |
| 29 | * TODO: Add requirement for Iteration order? Latest observed port first. |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 30 | * |
| 31 | * @return the device attachment points. |
| 32 | */ |
| 33 | public Iterable<Port> getAttachmentPoints(); |
Yuta HIGUCHI | 181d34d | 2014-02-05 15:05:46 -0800 | [diff] [blame] | 34 | |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 35 | /** |
| 36 | * Get the device last seen time. |
Ray Milkey | 269ffb9 | 2014-04-03 14:43:30 -0700 | [diff] [blame] | 37 | * <p/> |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 38 | * |
Yuta HIGUCHI | bf0a871 | 2014-06-30 18:59:46 -0700 | [diff] [blame] | 39 | * @return the device last seen time. (UTC in ms) |
Pavlin Radoslavov | 7c8f69a | 2014-02-19 19:01:45 -0800 | [diff] [blame] | 40 | */ |
| 41 | public long getLastSeenTime(); |
Jonathan Hart | 062a2e8 | 2014-02-03 09:41:57 -0800 | [diff] [blame] | 42 | } |