tom

More documentation clean-up.

1 package org.onlab.onos.event; 1 package org.onlab.onos.event;
2 2
3 /** 3 /**
4 - * Abstraction of a mechanism capable of accepting and dispatching events. 4 + * Abstraction of a mechanism capable of accepting and dispatching events to
5 - * Whether the events are accepted and the dispatched synchronously or 5 + * appropriate event sinks. Where the event sinks are obtained is unspecified.
6 - * asynchronously is unspecified. 6 + * Similarly, whether the events are accepted and dispatched synchronously
7 + * or asynchronously is unspecified as well.
7 */ 8 */
8 public interface EventDispatcher<E extends Event> { 9 public interface EventDispatcher<E extends Event> {
9 10
......
...@@ -3,14 +3,63 @@ package org.onlab.onos.net; ...@@ -3,14 +3,63 @@ package org.onlab.onos.net;
3 import org.onlab.onos.net.provider.Provided; 3 import org.onlab.onos.net.provider.Provided;
4 4
5 /** 5 /**
6 - * Representation of an network infrastructure device. 6 + * Representation of a network infrastructure device.
7 */ 7 */
8 public interface Device extends Provided { 8 public interface Device extends Provided {
9 9
10 - // type, e.g. switch, router, firewall, ips, controller 10 + /**
11 + * Coarse classification of the type of the infrastructure device.
12 + */
13 + public enum Type {
14 + SWITCH, ROUTER, FIREWALL, BALANCER, IPS, IDS, CONTROLLER, OTHER
15 + }
11 16
12 - // id (uri within) 17 + /**
18 + * Returns the device identifier.
19 + *
20 + * @return device id
21 + */
22 + DeviceId id();
13 23
14 - // ports 24 + /**
25 + * Returns the type of the infrastructure device.
26 + *
27 + * @return type of the device
28 + */
29 + Type type();
30 +
31 + /**
32 + * Returns the device manufacturer name.
33 + *
34 + * @return manufacturer name
35 + */
36 + String manufacturer();
37 +
38 + /**
39 + * Returns the device hardware version.
40 + *
41 + * @return hardware version
42 + */
43 + String hwVersion();
44 +
45 + /**
46 + * Returns the device software version.
47 + *
48 + * @return software version
49 + */
50 + String swVersion();
51 +
52 + /**
53 + * Returns the device serial number.
54 + *
55 + * @return serial number
56 + */
57 + String serialNumber();
58 +
59 + // Device realizedBy(); ?
60 +
61 + // ports are not provided directly, but rather via DeviceService.getPorts(Device device);
62 +
63 + // Set<Behavior> behaviours(); // set of supported behaviours
15 64
16 } 65 }
......
...@@ -5,7 +5,24 @@ import org.onlab.onos.net.provider.Provided; ...@@ -5,7 +5,24 @@ import org.onlab.onos.net.provider.Provided;
5 /** 5 /**
6 * Abstraction of a network infrastructure link. 6 * Abstraction of a network infrastructure link.
7 */ 7 */
8 -public interface Link extends Provided { // TODO: Also should extend graph Edge 8 +public interface Link extends Provided { // TODO: Also should extend graph Edge once the graph module is checked in
9 +
10 + /**
11 + * Coarse representation of the link type.
12 + */
13 + public enum Type {
14 + /**
15 + * Signifies that this is a direct single-segment link.
16 + */
17 + DIRECT,
18 +
19 + /**
20 + * Signifies that this link is potentially comprised from multiple
21 + * underlying segments or hops, e.g. optical links, tunnel links,
22 + * multi-hop links spanning 'dark' switches
23 + */
24 + INDIRECT
25 + }
9 26
10 /** 27 /**
11 * Returns the link source connection point. 28 * Returns the link source connection point.
...@@ -21,4 +38,6 @@ public interface Link extends Provided { // TODO: Also should extend graph Edge ...@@ -21,4 +38,6 @@ public interface Link extends Provided { // TODO: Also should extend graph Edge
21 */ 38 */
22 ConnectPoint dst(); 39 ConnectPoint dst();
23 40
41 + // LinkInfo info(); // Additional link information / decorations
42 +
24 } 43 }
......
1 +package org.onlab.onos.net.provider;
2 +
3 +/**
4 + * Base provider implementation.
5 + */
6 +public abstract class AbstractProvider implements Provider {
7 +
8 + private final ProviderId providerId;
9 +
10 + /**
11 + * Creates a provider with the supplier identifier.
12 + *
13 + * @param id provider id
14 + */
15 + protected AbstractProvider(ProviderId id) {
16 + this.providerId = id;
17 + }
18 +
19 + @Override
20 + public ProviderId id() {
21 + return providerId;
22 + }
23 +
24 +}
...@@ -10,6 +10,6 @@ public interface Provided { ...@@ -10,6 +10,6 @@ public interface Provided {
10 * 10 *
11 * @return provider identification 11 * @return provider identification
12 */ 12 */
13 - ProviderId id(); 13 + ProviderId providerId();
14 14
15 } 15 }
......