Merge branch 'master' of ssh://gerrit.onlab.us:29418/onos-next
Conflicts: core/api/src/main/java/org/onlab/onos/net/ElementId.java
Showing
4 changed files
with
62 additions
and
1 deletions
1 | package org.onlab.onos.net; | 1 | package org.onlab.onos.net; |
2 | 2 | ||
3 | +import java.net.URI; | ||
4 | +import java.util.Objects; | ||
5 | + | ||
3 | /** | 6 | /** |
4 | * Immutable representation of a network element identity. | 7 | * Immutable representation of a network element identity. |
5 | */ | 8 | */ |
6 | public abstract class ElementId { | 9 | public abstract class ElementId { |
10 | + | ||
11 | + private final URI uri; | ||
12 | + private final String str; | ||
13 | + | ||
14 | + // Default constructor for serialization | ||
15 | + protected ElementId() { | ||
16 | + this.uri = null; | ||
17 | + this.str = null; | ||
18 | + } | ||
19 | + | ||
20 | + /** | ||
21 | + * Creates an element identifier using the supplied URI. | ||
22 | + * | ||
23 | + * @param uri backing URI | ||
24 | + */ | ||
25 | + protected ElementId(URI uri) { | ||
26 | + this.uri = uri; | ||
27 | + this.str = uri.toString(); | ||
28 | + } | ||
29 | + | ||
30 | + /** | ||
31 | + * Returns the backing URI. | ||
32 | + * | ||
33 | + * @return backing URI | ||
34 | + */ | ||
35 | + public URI uri() { | ||
36 | + return uri; | ||
37 | + } | ||
38 | + | ||
39 | + @Override | ||
40 | + public int hashCode() { | ||
41 | + return Objects.hash(uri); | ||
42 | + } | ||
43 | + | ||
44 | + @Override | ||
45 | + public boolean equals(Object obj) { | ||
46 | + if (this == obj) { | ||
47 | + return true; | ||
48 | + } | ||
49 | + if (obj instanceof ElementId) { | ||
50 | + final ElementId that = (ElementId) obj; | ||
51 | + return this.getClass() == that.getClass() && | ||
52 | + Objects.equals(this.uri, that.uri); | ||
53 | + } | ||
54 | + return false; | ||
55 | + } | ||
56 | + | ||
57 | + @Override | ||
58 | + public String toString() { | ||
59 | + return str; | ||
60 | + } | ||
61 | + | ||
7 | } | 62 | } | ... | ... |
... | @@ -30,7 +30,7 @@ | ... | @@ -30,7 +30,7 @@ |
30 | <groupId>org.projectfloodlight</groupId> | 30 | <groupId>org.projectfloodlight</groupId> |
31 | <artifactId>openflowj</artifactId> | 31 | <artifactId>openflowj</artifactId> |
32 | <!-- FIXME once experimenter gets merged to upstream --> | 32 | <!-- FIXME once experimenter gets merged to upstream --> |
33 | - <version>0.3.8-optical_experimenter</version> | 33 | + <version>0.3.8-optical_experimenter2</version> |
34 | </dependency> | 34 | </dependency> |
35 | <dependency> | 35 | <dependency> |
36 | <groupId>io.netty</groupId> | 36 | <groupId>io.netty</groupId> | ... | ... |
... | @@ -57,6 +57,12 @@ public final class DriverManager implements OpenFlowSwitchDriverFactory { | ... | @@ -57,6 +57,12 @@ public final class DriverManager implements OpenFlowSwitchDriverFactory { |
57 | } | 57 | } |
58 | } | 58 | } |
59 | 59 | ||
60 | + String sw = desc.getSwDesc(); | ||
61 | + if (sw.startsWith("LINC-OE")) { | ||
62 | + log.debug("Optical Emulator LINC-OE with DPID:{} found..", dpid); | ||
63 | + return new OFOpticalSwitchImplLINC13(dpid, desc); | ||
64 | + } | ||
65 | + | ||
60 | log.warn("DriverManager could not identify switch desc: {}. " | 66 | log.warn("DriverManager could not identify switch desc: {}. " |
61 | + "Assigning AbstractOpenFlowSwich", desc); | 67 | + "Assigning AbstractOpenFlowSwich", desc); |
62 | return new AbstractOpenFlowSwitch(dpid, desc) { | 68 | return new AbstractOpenFlowSwitch(dpid, desc) { | ... | ... |
openflow/ctl/src/main/java/org/onlab/onos/openflow/drivers/impl/OFOpticalSwitchImplLINC13.java
0 → 100644
This diff is collapsed. Click to expand it.
-
Please register or login to post a comment