diff --git a/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java b/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java index 6074c67d05..74991c8a89 100644 --- a/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java +++ b/core/api/src/main/java/org/onlab/onos/net/DefaultEdgeLink.java @@ -18,9 +18,9 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink { * @param providerId provider identity * @param hostPoint host-side connection point * @param hostLocation location where host attaches to the network - * @param isIngress true to indicated host-to-network direction; false + * @param isIngress true to indicate host-to-network direction; false * for network-to-host direction - * @param annotations optional key/value annotations + * @param annotations optional key/value annotations */ public DefaultEdgeLink(ProviderId providerId, ConnectPoint hostPoint, HostLocation hostLocation, boolean isIngress, @@ -42,4 +42,20 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink { public HostLocation hostLocation() { return hostLocation; } + + /** + * Creates a phantom edge link, to an unspecified end-station. This link + * does not represent any actually discovered link stored in the system. + * + * @param edgePort network edge port + * @param isIngress true to indicate host-to-network direction; false + * for network-to-host direction + * @return new phantom edge link + */ + public static DefaultEdgeLink createEdgeLink(HostLocation edgePort, + boolean isIngress) { + return new DefaultEdgeLink(ProviderId.NONE, + new ConnectPoint(HostId.NONE, PortNumber.P0), + edgePort, isIngress); + } } diff --git a/core/api/src/main/java/org/onlab/onos/net/HostId.java b/core/api/src/main/java/org/onlab/onos/net/HostId.java index 1768f24a74..f2c03032b4 100644 --- a/core/api/src/main/java/org/onlab/onos/net/HostId.java +++ b/core/api/src/main/java/org/onlab/onos/net/HostId.java @@ -10,6 +10,14 @@ import java.net.URI; */ public final class HostId extends ElementId { + private static final String NIC = "nic"; + + /** + * Represents either no host, or an unspecified host; used for creating + * open ingress/egress edge links. + */ + public static final HostId NONE = hostId(NIC + ":none-0"); + // Public construction is prohibited private HostId(URI uri) { super(uri); @@ -43,8 +51,7 @@ public final class HostId extends ElementId { * @return host identifier */ public static HostId hostId(MacAddress mac, VlanId vlanId) { - // FIXME: use more efficient means of encoding - return hostId("nic" + ":" + mac + "-" + vlanId); + return hostId(NIC + ":" + mac + "-" + vlanId); } /** diff --git a/core/api/src/main/java/org/onlab/onos/net/PortNumber.java b/core/api/src/main/java/org/onlab/onos/net/PortNumber.java index cfb11d5646..60c3305e5d 100644 --- a/core/api/src/main/java/org/onlab/onos/net/PortNumber.java +++ b/core/api/src/main/java/org/onlab/onos/net/PortNumber.java @@ -9,6 +9,8 @@ import com.google.common.primitives.UnsignedLongs; */ public final class PortNumber { + public static final PortNumber P0 = portNumber(0); + // TODO: revisit the max and the logical port value assignments private static final long MAX_NUMBER = (2L * Integer.MAX_VALUE) + 1; diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/BatchOperation.java b/core/api/src/main/java/org/onlab/onos/net/intent/BatchOperation.java index ad34a2c29e..5d0cbb8950 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/BatchOperation.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/BatchOperation.java @@ -1,20 +1,20 @@ package org.onlab.onos.net.intent; //TODO is this the right package? -import static com.google.common.base.Preconditions.checkNotNull; - import java.util.Collections; import java.util.LinkedList; import java.util.List; +import static com.google.common.base.Preconditions.checkNotNull; + /** * A list of BatchOperationEntry. * * @param the enum of operators
- * This enum must be defined in each sub-classes. - * + * This enum must be defined in each sub-classes. */ public abstract class BatchOperation> { + private List ops; /** diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/ConnectivityIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/ConnectivityIntent.java index 629a9d1db9..70cec581fc 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/ConnectivityIntent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/ConnectivityIntent.java @@ -1,11 +1,10 @@ package org.onlab.onos.net.intent; -import static com.google.common.base.Preconditions.checkNotNull; - +import com.google.common.base.Objects; import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficTreatment; -import com.google.common.base.Objects; +import static com.google.common.base.Preconditions.checkNotNull; /** * Abstraction of connectivity intent for traffic matching some criteria. @@ -26,17 +25,18 @@ public abstract class ConnectivityIntent extends AbstractIntent { /** * Creates a connectivity intent that matches on the specified intent - * and applies the specified action. + * and applies the specified treatement. * - * @param id intent identifier - * @param match traffic match - * @param action action - * @throws NullPointerException if the match or action is null + * @param intentId intent identifier + * @param selector traffic selector + * @param treatement treatement + * @throws NullPointerException if the selector or treatement is null */ - protected ConnectivityIntent(IntentId id, TrafficSelector match, TrafficTreatment action) { - super(id); - this.selector = checkNotNull(match); - this.treatment = checkNotNull(action); + protected ConnectivityIntent(IntentId intentId, TrafficSelector selector, + TrafficTreatment treatement) { + super(intentId); + this.selector = checkNotNull(selector); + this.treatment = checkNotNull(treatement); } /** diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java index ff6e7c6b00..08063f079f 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/HostToHostIntent.java @@ -1,17 +1,16 @@ package org.onlab.onos.net.intent; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Objects; - +import com.google.common.base.MoreObjects; import org.onlab.onos.net.HostId; import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficTreatment; -import com.google.common.base.MoreObjects; +import java.util.Objects; + +import static com.google.common.base.Preconditions.checkNotNull; /** - * Abstraction of point-to-point connectivity. + * Abstraction of end-station to end-station connectivity. */ public class HostToHostIntent extends ConnectivityIntent { @@ -22,17 +21,15 @@ public class HostToHostIntent extends ConnectivityIntent { * Creates a new point-to-point intent with the supplied ingress/egress * ports. * - * @param id intent identifier - * @param match traffic match - * @param action action - * @param ingressPort ingress port - * @param egressPort egress port + * @param intentId intent identifier + * @param selector action + * @param treatment ingress port * @throws NullPointerException if {@code ingressPort} or {@code egressPort} - * is null. + * is null. */ - public HostToHostIntent(IntentId id, HostId src, HostId dst, - TrafficSelector selector, TrafficTreatment treatment) { - super(id, selector, treatment); + public HostToHostIntent(IntentId intentId, HostId src, HostId dst, + TrafficSelector selector, TrafficTreatment treatment) { + super(intentId, selector, treatment); this.src = checkNotNull(src); this.dst = checkNotNull(dst); } diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java b/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java index b239ede27f..d4c630a8d4 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/Intent.java @@ -2,7 +2,7 @@ package org.onlab.onos.net.intent; /** * Abstraction of an application level intent. - * + *

* Make sure that an Intent should be immutable when a new type is defined. */ public interface Intent extends BatchOperationTarget { diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java index b8f03443e8..c98e7887f3 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentEvent.java @@ -1,12 +1,11 @@ package org.onlab.onos.net.intent; -import static com.google.common.base.Preconditions.checkNotNull; +import com.google.common.base.MoreObjects; +import org.onlab.onos.event.AbstractEvent; import java.util.Objects; -import org.onlab.onos.event.AbstractEvent; - -import com.google.common.base.MoreObjects; +import static com.google.common.base.Preconditions.checkNotNull; /** * A class to represent an intent related event. @@ -24,10 +23,10 @@ public class IntentEvent extends AbstractEvent { /** * Creates an event describing a state change of an intent. * - * @param intent subject intent - * @param state new intent state + * @param intent subject intent + * @param state new intent state * @param previous previous intent state - * @param time time the event created in milliseconds since start of epoch + * @param time time the event created in milliseconds since start of epoch * @throws NullPointerException if the intent or state is null */ public IntentEvent(Intent intent, IntentState state, IntentState previous, long time) { diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentException.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentException.java index 4148dea438..fff55bed4b 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentException.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentException.java @@ -26,7 +26,7 @@ public class IntentException extends RuntimeException { * Constructs an exception with the specified message and the underlying cause. * * @param message the message describing the specific nature of the error - * @param cause the underlying cause of this error + * @param cause the underlying cause of this error */ public IntentException(String message, Throwable cause) { super(message, cause); diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentExtensionService.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentExtensionService.java index c6338a7f9a..8deb3728b2 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentExtensionService.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentExtensionService.java @@ -10,9 +10,9 @@ public interface IntentExtensionService { /** * Registers the specified compiler for the given intent class. * - * @param cls intent class + * @param cls intent class * @param compiler intent compiler - * @param the type of intent + * @param the type of intent */ void registerCompiler(Class cls, IntentCompiler compiler); @@ -34,9 +34,9 @@ public interface IntentExtensionService { /** * Registers the specified installer for the given installable intent class. * - * @param cls installable intent class + * @param cls installable intent class * @param installer intent installer - * @param the type of installable intent + * @param the type of installable intent */ void registerInstaller(Class cls, IntentInstaller installer); diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentId.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentId.java index 798e00ca05..8f132c0323 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentId.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentId.java @@ -2,7 +2,7 @@ package org.onlab.onos.net.intent; /** * Intent identifier suitable as an external key. - * + *

* This class is immutable. */ public final class IntentId implements BatchOperationTarget { diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentService.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentService.java index 8d550e87e9..c3aae5409c 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentService.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentService.java @@ -7,7 +7,7 @@ package org.onlab.onos.net.intent; public interface IntentService { /** * Submits an intent into the system. - * + *

* This is an asynchronous request meaning that any compiling or * installation activities may be done at later time. * @@ -17,7 +17,7 @@ public interface IntentService { /** * Withdraws an intent from the system. - * + *

* This is an asynchronous request meaning that the environment may be * affected at later time. * @@ -28,7 +28,7 @@ public interface IntentService { /** * Submits a batch of submit & withdraw operations. Such a batch is * assumed to be processed together. - * + *

* This is an asynchronous request meaning that the environment may be * affected at later time. * @@ -63,7 +63,7 @@ public interface IntentService { * * @param id intent identifier * @return the intent state or null if one with the given identifier is not - * found + * found */ IntentState getIntentState(IntentId id); diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentStore.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentStore.java index 792398e8d6..037f1795ae 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentStore.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentStore.java @@ -1,9 +1,9 @@ package org.onlab.onos.net.intent; -import java.util.List; - import org.onlab.onos.store.Store; +import java.util.List; + /** * Manages inventory of end-station intents; not intended for direct use. */ @@ -21,13 +21,12 @@ public interface IntentStore extends Store { * Removes the specified intent from the inventory. * * @param intentId intent identification - * @return remove event or null if intent was not found + * @return removed state transition event or null if intent was not found */ - IntentEvent removeIntent(IntentId intent); + IntentEvent removeIntent(IntentId intentId); /** * Returns the number of intents in the store. - * */ long getIntentCount(); @@ -46,19 +45,52 @@ public interface IntentStore extends Store { */ Intent getIntent(IntentId intentId); - IntentState getIntentState(IntentId id); + /** + * Returns the state of the specified intent. + * + * @param intentId intent identification + * @return current intent state + */ + IntentState getIntentState(IntentId intentId); /** * Sets the state of the specified intent to the new state. * - * @param intent intent whose state is to be changed + * @param intent intent whose state is to be changed * @param newState new state + * @return state transition event */ IntentEvent setState(Intent intent, IntentState newState); - IntentEvent addInstallableIntents(IntentId intentId, List result); + /** + * Adds the installable intents which resulted from compilation of the + * specified original intent. + * + * @param intentId original intent identifier + * @param installableIntents compiled installable intents + * @return compiled state transition event + */ + IntentEvent addInstallableIntents(IntentId intentId, + List installableIntents); + /** + * Returns the list of the installable events associated with the specified + * original intent. + * + * @param intentId original intent identifier + * @return compiled installable intents + */ List getInstallableIntents(IntentId intentId); + // TODO: this should be triggered from with the store as a result of removeIntent call + + /** + * Removes any installable intents which resulted from compilation of the + * specified original intent. + * + * @param intentId original intent identifier + * @return compiled state transition event + */ void removeInstalledIntents(IntentId intentId); + } diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/IntentStoreDelegate.java b/core/api/src/main/java/org/onlab/onos/net/intent/IntentStoreDelegate.java index 5a4da1a82a..6c37db82a7 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/IntentStoreDelegate.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/IntentStoreDelegate.java @@ -3,7 +3,7 @@ package org.onlab.onos.net.intent; import org.onlab.onos.store.StoreDelegate; /** - * Infrastructure link store delegate abstraction. + * Intent store delegate abstraction. */ public interface IntentStoreDelegate extends StoreDelegate { } diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/MultiPointToSinglePointIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/MultiPointToSinglePointIntent.java index 1e421abac0..af1e84b5ea 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/MultiPointToSinglePointIntent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/MultiPointToSinglePointIntent.java @@ -30,18 +30,20 @@ public class MultiPointToSinglePointIntent extends ConnectivityIntent { * @param action action * @param ingressPorts set of ports from which ingress traffic originates * @param egressPort port to which traffic will egress - * @throws NullPointerException if {@code ingressPorts} or - * {@code egressPort} is null. + * @throws NullPointerException if {@code ingressPorts} or + * {@code egressPort} is null. * @throws IllegalArgumentException if the size of {@code ingressPorts} is - * not more than 1 + * not more than 1 */ - public MultiPointToSinglePointIntent(IntentId id, TrafficSelector match, TrafficTreatment action, - Set ingressPorts, ConnectPoint egressPort) { + public MultiPointToSinglePointIntent(IntentId id, TrafficSelector match, + TrafficTreatment action, + Set ingressPorts, + ConnectPoint egressPort) { super(id, match, action); checkNotNull(ingressPorts); checkArgument(!ingressPorts.isEmpty(), - "there should be at least one ingress port"); + "there should be at least one ingress port"); this.ingressPorts = Sets.newHashSet(ingressPorts); this.egressPort = checkNotNull(egressPort); diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java index d11dc7cbc9..b99eb700cc 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/OpticalConnectivityIntent.java @@ -3,30 +3,30 @@ package org.onlab.onos.net.intent; import org.onlab.onos.net.ConnectPoint; // TODO: consider if this intent should be sub-class of ConnectivityIntent + /** * An optical layer Intent for a connectivity from a transponder port to another * transponder port. - *

+ *

* This class doesn't accepts lambda specifier. This class computes path between * ports and assign lambda automatically. The lambda can be specified using * OpticalPathFlow class. */ public class OpticalConnectivityIntent extends AbstractIntent { - protected ConnectPoint srcConnectPoint; - protected ConnectPoint dstConnectPoint; + protected ConnectPoint src; + protected ConnectPoint dst; /** * Constructor. * - * @param id ID for this new Intent object. - * @param srcConnectPoint The source transponder port. - * @param dstConnectPoint The destination transponder port. + * @param id ID for this new Intent object. + * @param src The source transponder port. + * @param dst The destination transponder port. */ - public OpticalConnectivityIntent(IntentId id, - ConnectPoint srcConnectPoint, ConnectPoint dstConnectPoint) { + public OpticalConnectivityIntent(IntentId id, ConnectPoint src, ConnectPoint dst) { super(id); - this.srcConnectPoint = srcConnectPoint; - this.dstConnectPoint = dstConnectPoint; + this.src = src; + this.dst = dst; } /** @@ -34,8 +34,8 @@ public class OpticalConnectivityIntent extends AbstractIntent { */ protected OpticalConnectivityIntent() { super(); - this.srcConnectPoint = null; - this.dstConnectPoint = null; + this.src = null; + this.dst = null; } /** @@ -44,7 +44,7 @@ public class OpticalConnectivityIntent extends AbstractIntent { * @return The source transponder port. */ public ConnectPoint getSrcConnectPoint() { - return srcConnectPoint; + return src; } /** @@ -52,7 +52,7 @@ public class OpticalConnectivityIntent extends AbstractIntent { * * @return The source transponder port. */ - public ConnectPoint getDstConnectPoint() { - return dstConnectPoint; + public ConnectPoint getDst() { + return dst; } } diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/PointToPointIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/PointToPointIntent.java index b1d18ee416..4c86baee5d 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/PointToPointIntent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/PointToPointIntent.java @@ -1,14 +1,13 @@ package org.onlab.onos.net.intent; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Objects; - +import com.google.common.base.MoreObjects; import org.onlab.onos.net.ConnectPoint; import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficTreatment; -import com.google.common.base.MoreObjects; +import java.util.Objects; + +import static com.google.common.base.Preconditions.checkNotNull; /** * Abstraction of point-to-point connectivity. @@ -23,15 +22,17 @@ public class PointToPointIntent extends ConnectivityIntent { * ports. * * @param id intent identifier - * @param match traffic match - * @param action action + * @param selector traffic selector + * @param treatment treatment * @param ingressPort ingress port * @param egressPort egress port * @throws NullPointerException if {@code ingressPort} or {@code egressPort} is null. */ - public PointToPointIntent(IntentId id, TrafficSelector match, TrafficTreatment action, - ConnectPoint ingressPort, ConnectPoint egressPort) { - super(id, match, action); + public PointToPointIntent(IntentId id, TrafficSelector selector, + TrafficTreatment treatment, + ConnectPoint ingressPort, + ConnectPoint egressPort) { + super(id, selector, treatment); this.ingressPort = checkNotNull(ingressPort); this.egressPort = checkNotNull(egressPort); } diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/SinglePointToMultiPointIntent.java b/core/api/src/main/java/org/onlab/onos/net/intent/SinglePointToMultiPointIntent.java index e69a740a89..af2616ba63 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/SinglePointToMultiPointIntent.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/SinglePointToMultiPointIntent.java @@ -1,17 +1,16 @@ package org.onlab.onos.net.intent; -import static com.google.common.base.Preconditions.checkArgument; -import static com.google.common.base.Preconditions.checkNotNull; - -import java.util.Objects; -import java.util.Set; - +import com.google.common.base.MoreObjects; +import com.google.common.collect.Sets; import org.onlab.onos.net.ConnectPoint; import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficTreatment; -import com.google.common.base.MoreObjects; -import com.google.common.collect.Sets; +import java.util.Objects; +import java.util.Set; + +import static com.google.common.base.Preconditions.checkArgument; +import static com.google.common.base.Preconditions.checkNotNull; /** * Abstraction of single source, multiple destination connectivity intent. @@ -25,23 +24,24 @@ public class SinglePointToMultiPointIntent extends ConnectivityIntent { * Creates a new single-to-multi point connectivity intent. * * @param id intent identifier - * @param match traffic match - * @param action action + * @param selector traffic selector + * @param treatment treatment * @param ingressPort port on which traffic will ingress * @param egressPorts set of ports on which traffic will egress - * @throws NullPointerException if {@code ingressPort} or - * {@code egressPorts} is null + * @throws NullPointerException if {@code ingressPort} or + * {@code egressPorts} is null * @throws IllegalArgumentException if the size of {@code egressPorts} is - * not more than 1 + * not more than 1 */ - public SinglePointToMultiPointIntent(IntentId id, TrafficSelector match, TrafficTreatment action, + public SinglePointToMultiPointIntent(IntentId id, TrafficSelector selector, + TrafficTreatment treatment, ConnectPoint ingressPort, Set egressPorts) { - super(id, match, action); + super(id, selector, treatment); checkNotNull(egressPorts); checkArgument(!egressPorts.isEmpty(), - "there should be at least one egress port"); + "there should be at least one egress port"); this.ingressPort = checkNotNull(ingressPort); this.egressPorts = Sets.newHashSet(egressPorts); diff --git a/core/api/src/main/java/org/onlab/onos/net/intent/package-info.java b/core/api/src/main/java/org/onlab/onos/net/intent/package-info.java index e1e6782b7b..25170671e1 100644 --- a/core/api/src/main/java/org/onlab/onos/net/intent/package-info.java +++ b/core/api/src/main/java/org/onlab/onos/net/intent/package-info.java @@ -1,5 +1,8 @@ /** - * Intent Package. TODO + * Set of abstractions for conveying high-level intents for treatment of + * selected network traffic by allowing applications to express the + * what rather than the how. This makes such instructions + * largely independent of topology and device specifics, thus allowing them to + * survive topology mutations. */ - package org.onlab.onos.net.intent; \ No newline at end of file diff --git a/core/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java b/core/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java index afaecbea0a..c2a3133d13 100644 --- a/core/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java +++ b/core/api/src/main/java/org/onlab/onos/net/provider/ProviderId.java @@ -3,6 +3,7 @@ package org.onlab.onos.net.provider; import java.util.Objects; import static com.google.common.base.MoreObjects.toStringHelper; +import static com.google.common.base.Preconditions.checkNotNull; /** * External identity of a {@link org.onlab.onos.net.provider.Provider} family. @@ -19,10 +20,22 @@ import static com.google.common.base.MoreObjects.toStringHelper; */ public class ProviderId { + /** + * Represents no provider ID. + */ + public static final ProviderId NONE = new ProviderId(); + private final String scheme; private final String id; private final boolean ancillary; + // For serialization + private ProviderId() { + scheme = null; + id = null; + ancillary = false; + } + /** * Creates a new primary provider identifier from the specified string. * The providers are expected to follow the reverse DNS convention, e.g. @@ -45,8 +58,8 @@ public class ProviderId { * @param ancillary ancillary provider indicator */ public ProviderId(String scheme, String id, boolean ancillary) { - this.scheme = scheme; - this.id = id; + this.scheme = checkNotNull(scheme, "Scheme cannot be null"); + this.id = checkNotNull(id, "ID cannot be null"); this.ancillary = ancillary; } diff --git a/core/net/src/main/java/org/onlab/onos/net/intent/impl/IdBlockAllocatorBasedIntentIdGenerator.java b/core/net/src/main/java/org/onlab/onos/net/intent/impl/IdBlockAllocatorBasedIntentIdGenerator.java index b8c5c9b260..9620e59d7a 100644 --- a/core/net/src/main/java/org/onlab/onos/net/intent/impl/IdBlockAllocatorBasedIntentIdGenerator.java +++ b/core/net/src/main/java/org/onlab/onos/net/intent/impl/IdBlockAllocatorBasedIntentIdGenerator.java @@ -3,7 +3,7 @@ package org.onlab.onos.net.intent.impl; import org.onlab.onos.net.intent.IntentId; /** - * An implementation of {@link net.onrc.onos.core.util.IdGenerator} of intent ID, + * An implementation of {@link org.onlab.onos.net.intent.IdGenerator} of intent ID, * which uses {@link IdBlockAllocator}. */ public class IdBlockAllocatorBasedIntentIdGenerator extends AbstractBlockAllocatorBasedIdGenerator { diff --git a/core/net/src/main/java/org/onlab/onos/net/intent/impl/package-info.java b/core/net/src/main/java/org/onlab/onos/net/intent/impl/package-info.java index fa8248e7df..3f0027159b 100644 --- a/core/net/src/main/java/org/onlab/onos/net/intent/impl/package-info.java +++ b/core/net/src/main/java/org/onlab/onos/net/intent/impl/package-info.java @@ -1,4 +1,5 @@ /** - * Intent Service Implementation. TODO + * Core subsystem for tracking high-level intents for treatment of selected + * network traffic. */ package org.onlab.onos.net.intent.impl; \ No newline at end of file diff --git a/core/store/dist/src/main/java/org/onlab/onos/store/cluster/messaging/impl/package-info.java b/core/store/dist/src/main/java/org/onlab/onos/store/cluster/messaging/impl/package-info.java new file mode 100644 index 0000000000..6c1e71b0d8 --- /dev/null +++ b/core/store/dist/src/main/java/org/onlab/onos/store/cluster/messaging/impl/package-info.java @@ -0,0 +1,4 @@ +/** + * Implementation of the cluster messaging mechanism. + */ +package org.onlab.onos.store.cluster.messaging.impl; \ No newline at end of file diff --git a/pom.xml b/pom.xml index cb00f32295..665d1b00d9 100644 --- a/pom.xml +++ b/pom.xml @@ -480,7 +480,7 @@ Core Subsystems - org.onlab.onos.cluster.impl:org.onlab.onos.net.device.impl:org.onlab.onos.net.link.impl:org.onlab.onos.net.host.impl:org.onlab.onos.net.topology.impl:org.onlab.onos.net.packet.impl:org.onlab.onos.net.flow.impl:org.onlab.onos.store.trivial.*:org.onlab.onos.net.*.impl:org.onlab.onos.event.impl:org.onlab.onos.store.* + org.onlab.onos.cluster.impl:org.onlab.onos.net.device.impl:org.onlab.onos.net.link.impl:org.onlab.onos.net.host.impl:org.onlab.onos.net.topology.impl:org.onlab.onos.net.packet.impl:org.onlab.onos.net.flow.impl:org.onlab.onos.store.trivial.*:org.onlab.onos.net.*.impl:org.onlab.onos.event.impl:org.onlab.onos.store.*:org.onlab.onos.net.intent.impl