Corrected some javadocs.
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 6074c67..74991c8 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 @@
* @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 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 1768f24..f2c0303 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 @@
*/
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 @@
* @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 cfb11d5..60c3305 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 @@
*/
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 ad34a2c..5d0cbb8 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 <T> the enum of operators <br>
- * This enum must be defined in each sub-classes.
- *
+ * This enum must be defined in each sub-classes.
*/
public abstract class BatchOperation<T extends BatchOperationEntry<?, ?>> {
+
private List<T> 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 629a9d1..70cec58 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 @@
/**
* 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 ff6e7c6..08063f0 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 @@
* 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 b239ede..d4c630a 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 @@
/**
* Abstraction of an application level intent.
- *
+ * <p/>
* 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 b8f0344..c98e788 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 @@
/**
* 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 4148dea..fff55be 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 @@
* 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 c6338a7f..8deb372 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 @@
/**
* Registers the specified compiler for the given intent class.
*
- * @param cls intent class
+ * @param cls intent class
* @param compiler intent compiler
- * @param <T> the type of intent
+ * @param <T> the type of intent
*/
<T extends Intent> void registerCompiler(Class<T> cls, IntentCompiler<T> compiler);
@@ -34,9 +34,9 @@
/**
* 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 <T> the type of installable intent
+ * @param <T> the type of installable intent
*/
<T extends InstallableIntent> void registerInstaller(Class<T> cls, IntentInstaller<T> 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 798e00c..8f132c0 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 @@
/**
* Intent identifier suitable as an external key.
- *
+ * <p/>
* 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 8d550e8..c3aae54 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 @@
public interface IntentService {
/**
* Submits an intent into the system.
- *
+ * <p/>
* This is an asynchronous request meaning that any compiling or
* installation activities may be done at later time.
*
@@ -17,7 +17,7 @@
/**
* Withdraws an intent from the system.
- *
+ * <p/>
* This is an asynchronous request meaning that the environment may be
* affected at later time.
*
@@ -28,7 +28,7 @@
/**
* Submits a batch of submit & withdraw operations. Such a batch is
* assumed to be processed together.
- *
+ * <p/>
* This is an asynchronous request meaning that the environment may be
* affected at later time.
*
@@ -63,7 +63,7 @@
*
* @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 792398e..037f179 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 @@
* 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 @@
*/
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<InstallableIntent> 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<InstallableIntent> installableIntents);
+ /**
+ * Returns the list of the installable events associated with the specified
+ * original intent.
+ *
+ * @param intentId original intent identifier
+ * @return compiled installable intents
+ */
List<InstallableIntent> 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 5a4da1a..6c37db8 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 @@
import org.onlab.onos.store.StoreDelegate;
/**
- * Infrastructure link store delegate abstraction.
+ * Intent store delegate abstraction.
*/
public interface IntentStoreDelegate extends StoreDelegate<IntentEvent> {
}
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 1e421ab..af1e84b 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 @@
* @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<ConnectPoint> ingressPorts, ConnectPoint egressPort) {
+ public MultiPointToSinglePointIntent(IntentId id, TrafficSelector match,
+ TrafficTreatment action,
+ Set<ConnectPoint> 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 d11dc7c..b99eb70 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 @@
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.
- * <p>
+ * <p/>
* 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 @@
*/
protected OpticalConnectivityIntent() {
super();
- this.srcConnectPoint = null;
- this.dstConnectPoint = null;
+ this.src = null;
+ this.dst = null;
}
/**
@@ -44,7 +44,7 @@
* @return The source transponder port.
*/
public ConnectPoint getSrcConnectPoint() {
- return srcConnectPoint;
+ return src;
}
/**
@@ -52,7 +52,7 @@
*
* @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 b1d18ee..4c86bae 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 @@
* 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 e69a740..af2616b 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 @@
* 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<ConnectPoint> 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 e1e6782..2517067 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
+ * <em>what</em> rather than the <em>how</em>. 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 afaecbe..c2a3133 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 @@
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 @@
*/
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 @@
* @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;
}