Corrected some javadocs.

This commit is contained in:
tom 2014-10-02 23:45:11 -07:00
parent 68b349491e
commit a1d16b655d
24 changed files with 193 additions and 116 deletions

View File

@ -18,9 +18,9 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink {
* @param providerId provider identity * @param providerId provider identity
* @param hostPoint host-side connection point * @param hostPoint host-side connection point
* @param hostLocation location where host attaches to the network * @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 * for network-to-host direction
* @param annotations optional key/value annotations * @param annotations optional key/value annotations
*/ */
public DefaultEdgeLink(ProviderId providerId, ConnectPoint hostPoint, public DefaultEdgeLink(ProviderId providerId, ConnectPoint hostPoint,
HostLocation hostLocation, boolean isIngress, HostLocation hostLocation, boolean isIngress,
@ -42,4 +42,20 @@ public class DefaultEdgeLink extends DefaultLink implements EdgeLink {
public HostLocation hostLocation() { public HostLocation hostLocation() {
return 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);
}
} }

View File

@ -10,6 +10,14 @@ import java.net.URI;
*/ */
public final class HostId extends ElementId { 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 // Public construction is prohibited
private HostId(URI uri) { private HostId(URI uri) {
super(uri); super(uri);
@ -43,8 +51,7 @@ public final class HostId extends ElementId {
* @return host identifier * @return host identifier
*/ */
public static HostId hostId(MacAddress mac, VlanId vlanId) { 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);
} }
/** /**

View File

@ -9,6 +9,8 @@ import com.google.common.primitives.UnsignedLongs;
*/ */
public final class PortNumber { public final class PortNumber {
public static final PortNumber P0 = portNumber(0);
// TODO: revisit the max and the logical port value assignments // TODO: revisit the max and the logical port value assignments
private static final long MAX_NUMBER = (2L * Integer.MAX_VALUE) + 1; private static final long MAX_NUMBER = (2L * Integer.MAX_VALUE) + 1;

View File

@ -1,20 +1,20 @@
package org.onlab.onos.net.intent; package org.onlab.onos.net.intent;
//TODO is this the right package? //TODO is this the right package?
import static com.google.common.base.Preconditions.checkNotNull;
import java.util.Collections; import java.util.Collections;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import static com.google.common.base.Preconditions.checkNotNull;
/** /**
* A list of BatchOperationEntry. * A list of BatchOperationEntry.
* *
* @param <T> the enum of operators <br> * @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<?, ?>> { public abstract class BatchOperation<T extends BatchOperationEntry<?, ?>> {
private List<T> ops; private List<T> ops;
/** /**

View File

@ -1,11 +1,10 @@
package org.onlab.onos.net.intent; 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.TrafficSelector;
import org.onlab.onos.net.flow.TrafficTreatment; 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. * 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 * 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 intentId intent identifier
* @param match traffic match * @param selector traffic selector
* @param action action * @param treatement treatement
* @throws NullPointerException if the match or action is null * @throws NullPointerException if the selector or treatement is null
*/ */
protected ConnectivityIntent(IntentId id, TrafficSelector match, TrafficTreatment action) { protected ConnectivityIntent(IntentId intentId, TrafficSelector selector,
super(id); TrafficTreatment treatement) {
this.selector = checkNotNull(match); super(intentId);
this.treatment = checkNotNull(action); this.selector = checkNotNull(selector);
this.treatment = checkNotNull(treatement);
} }
/** /**

View File

@ -1,17 +1,16 @@
package org.onlab.onos.net.intent; package org.onlab.onos.net.intent;
import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.MoreObjects;
import java.util.Objects;
import org.onlab.onos.net.HostId; import org.onlab.onos.net.HostId;
import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficSelector;
import org.onlab.onos.net.flow.TrafficTreatment; 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 { 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 * Creates a new point-to-point intent with the supplied ingress/egress
* ports. * ports.
* *
* @param id intent identifier * @param intentId intent identifier
* @param match traffic match * @param selector action
* @param action action * @param treatment ingress port
* @param ingressPort ingress port
* @param egressPort egress port
* @throws NullPointerException if {@code ingressPort} or {@code egressPort} * @throws NullPointerException if {@code ingressPort} or {@code egressPort}
* is null. * is null.
*/ */
public HostToHostIntent(IntentId id, HostId src, HostId dst, public HostToHostIntent(IntentId intentId, HostId src, HostId dst,
TrafficSelector selector, TrafficTreatment treatment) { TrafficSelector selector, TrafficTreatment treatment) {
super(id, selector, treatment); super(intentId, selector, treatment);
this.src = checkNotNull(src); this.src = checkNotNull(src);
this.dst = checkNotNull(dst); this.dst = checkNotNull(dst);
} }

View File

@ -2,7 +2,7 @@ package org.onlab.onos.net.intent;
/** /**
* Abstraction of an application level intent. * Abstraction of an application level intent.
* * <p/>
* Make sure that an Intent should be immutable when a new type is defined. * Make sure that an Intent should be immutable when a new type is defined.
*/ */
public interface Intent extends BatchOperationTarget { public interface Intent extends BatchOperationTarget {

View File

@ -1,12 +1,11 @@
package org.onlab.onos.net.intent; 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 java.util.Objects;
import org.onlab.onos.event.AbstractEvent; import static com.google.common.base.Preconditions.checkNotNull;
import com.google.common.base.MoreObjects;
/** /**
* A class to represent an intent related event. * A class to represent an intent related event.
@ -24,10 +23,10 @@ public class IntentEvent extends AbstractEvent<IntentState, Intent> {
/** /**
* Creates an event describing a state change of an intent. * Creates an event describing a state change of an intent.
* *
* @param intent subject intent * @param intent subject intent
* @param state new intent state * @param state new intent state
* @param previous previous 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 * @throws NullPointerException if the intent or state is null
*/ */
public IntentEvent(Intent intent, IntentState state, IntentState previous, long time) { public IntentEvent(Intent intent, IntentState state, IntentState previous, long time) {

View File

@ -26,7 +26,7 @@ public class IntentException extends RuntimeException {
* Constructs an exception with the specified message and the underlying cause. * Constructs an exception with the specified message and the underlying cause.
* *
* @param message the message describing the specific nature of the error * @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) { public IntentException(String message, Throwable cause) {
super(message, cause); super(message, cause);

View File

@ -10,9 +10,9 @@ public interface IntentExtensionService {
/** /**
* Registers the specified compiler for the given intent class. * Registers the specified compiler for the given intent class.
* *
* @param cls intent class * @param cls intent class
* @param compiler intent compiler * @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); <T extends Intent> void registerCompiler(Class<T> cls, IntentCompiler<T> compiler);
@ -34,9 +34,9 @@ public interface IntentExtensionService {
/** /**
* Registers the specified installer for the given installable intent class. * 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 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); <T extends InstallableIntent> void registerInstaller(Class<T> cls, IntentInstaller<T> installer);

View File

@ -2,7 +2,7 @@ package org.onlab.onos.net.intent;
/** /**
* Intent identifier suitable as an external key. * Intent identifier suitable as an external key.
* * <p/>
* This class is immutable. * This class is immutable.
*/ */
public final class IntentId implements BatchOperationTarget { public final class IntentId implements BatchOperationTarget {

View File

@ -7,7 +7,7 @@ package org.onlab.onos.net.intent;
public interface IntentService { public interface IntentService {
/** /**
* Submits an intent into the system. * Submits an intent into the system.
* * <p/>
* This is an asynchronous request meaning that any compiling or * This is an asynchronous request meaning that any compiling or
* installation activities may be done at later time. * installation activities may be done at later time.
* *
@ -17,7 +17,7 @@ public interface IntentService {
/** /**
* Withdraws an intent from the system. * Withdraws an intent from the system.
* * <p/>
* This is an asynchronous request meaning that the environment may be * This is an asynchronous request meaning that the environment may be
* affected at later time. * affected at later time.
* *
@ -28,7 +28,7 @@ public interface IntentService {
/** /**
* Submits a batch of submit &amp; withdraw operations. Such a batch is * Submits a batch of submit &amp; withdraw operations. Such a batch is
* assumed to be processed together. * assumed to be processed together.
* * <p/>
* This is an asynchronous request meaning that the environment may be * This is an asynchronous request meaning that the environment may be
* affected at later time. * affected at later time.
* *
@ -63,7 +63,7 @@ public interface IntentService {
* *
* @param id intent identifier * @param id intent identifier
* @return the intent state or null if one with the given identifier is not * @return the intent state or null if one with the given identifier is not
* found * found
*/ */
IntentState getIntentState(IntentId id); IntentState getIntentState(IntentId id);

View File

@ -1,9 +1,9 @@
package org.onlab.onos.net.intent; package org.onlab.onos.net.intent;
import java.util.List;
import org.onlab.onos.store.Store; import org.onlab.onos.store.Store;
import java.util.List;
/** /**
* Manages inventory of end-station intents; not intended for direct use. * Manages inventory of end-station intents; not intended for direct use.
*/ */
@ -21,13 +21,12 @@ public interface IntentStore extends Store<IntentEvent, IntentStoreDelegate> {
* Removes the specified intent from the inventory. * Removes the specified intent from the inventory.
* *
* @param intentId intent identification * @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. * Returns the number of intents in the store.
*
*/ */
long getIntentCount(); long getIntentCount();
@ -46,19 +45,52 @@ public interface IntentStore extends Store<IntentEvent, IntentStoreDelegate> {
*/ */
Intent getIntent(IntentId intentId); 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. * 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 * @param newState new state
* @return state transition event
*/ */
IntentEvent setState(Intent intent, IntentState newState); 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); 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); void removeInstalledIntents(IntentId intentId);
} }

View File

@ -3,7 +3,7 @@ package org.onlab.onos.net.intent;
import org.onlab.onos.store.StoreDelegate; import org.onlab.onos.store.StoreDelegate;
/** /**
* Infrastructure link store delegate abstraction. * Intent store delegate abstraction.
*/ */
public interface IntentStoreDelegate extends StoreDelegate<IntentEvent> { public interface IntentStoreDelegate extends StoreDelegate<IntentEvent> {
} }

View File

@ -30,18 +30,20 @@ public class MultiPointToSinglePointIntent extends ConnectivityIntent {
* @param action action * @param action action
* @param ingressPorts set of ports from which ingress traffic originates * @param ingressPorts set of ports from which ingress traffic originates
* @param egressPort port to which traffic will egress * @param egressPort port to which traffic will egress
* @throws NullPointerException if {@code ingressPorts} or * @throws NullPointerException if {@code ingressPorts} or
* {@code egressPort} is null. * {@code egressPort} is null.
* @throws IllegalArgumentException if the size of {@code ingressPorts} is * @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, public MultiPointToSinglePointIntent(IntentId id, TrafficSelector match,
Set<ConnectPoint> ingressPorts, ConnectPoint egressPort) { TrafficTreatment action,
Set<ConnectPoint> ingressPorts,
ConnectPoint egressPort) {
super(id, match, action); super(id, match, action);
checkNotNull(ingressPorts); checkNotNull(ingressPorts);
checkArgument(!ingressPorts.isEmpty(), 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.ingressPorts = Sets.newHashSet(ingressPorts);
this.egressPort = checkNotNull(egressPort); this.egressPort = checkNotNull(egressPort);

View File

@ -3,30 +3,30 @@ package org.onlab.onos.net.intent;
import org.onlab.onos.net.ConnectPoint; import org.onlab.onos.net.ConnectPoint;
// TODO: consider if this intent should be sub-class of ConnectivityIntent // TODO: consider if this intent should be sub-class of ConnectivityIntent
/** /**
* An optical layer Intent for a connectivity from a transponder port to another * An optical layer Intent for a connectivity from a transponder port to another
* transponder port. * transponder port.
* <p> * <p/>
* This class doesn't accepts lambda specifier. This class computes path between * This class doesn't accepts lambda specifier. This class computes path between
* ports and assign lambda automatically. The lambda can be specified using * ports and assign lambda automatically. The lambda can be specified using
* OpticalPathFlow class. * OpticalPathFlow class.
*/ */
public class OpticalConnectivityIntent extends AbstractIntent { public class OpticalConnectivityIntent extends AbstractIntent {
protected ConnectPoint srcConnectPoint; protected ConnectPoint src;
protected ConnectPoint dstConnectPoint; protected ConnectPoint dst;
/** /**
* Constructor. * Constructor.
* *
* @param id ID for this new Intent object. * @param id ID for this new Intent object.
* @param srcConnectPoint The source transponder port. * @param src The source transponder port.
* @param dstConnectPoint The destination transponder port. * @param dst The destination transponder port.
*/ */
public OpticalConnectivityIntent(IntentId id, public OpticalConnectivityIntent(IntentId id, ConnectPoint src, ConnectPoint dst) {
ConnectPoint srcConnectPoint, ConnectPoint dstConnectPoint) {
super(id); super(id);
this.srcConnectPoint = srcConnectPoint; this.src = src;
this.dstConnectPoint = dstConnectPoint; this.dst = dst;
} }
/** /**
@ -34,8 +34,8 @@ public class OpticalConnectivityIntent extends AbstractIntent {
*/ */
protected OpticalConnectivityIntent() { protected OpticalConnectivityIntent() {
super(); super();
this.srcConnectPoint = null; this.src = null;
this.dstConnectPoint = null; this.dst = null;
} }
/** /**
@ -44,7 +44,7 @@ public class OpticalConnectivityIntent extends AbstractIntent {
* @return The source transponder port. * @return The source transponder port.
*/ */
public ConnectPoint getSrcConnectPoint() { public ConnectPoint getSrcConnectPoint() {
return srcConnectPoint; return src;
} }
/** /**
@ -52,7 +52,7 @@ public class OpticalConnectivityIntent extends AbstractIntent {
* *
* @return The source transponder port. * @return The source transponder port.
*/ */
public ConnectPoint getDstConnectPoint() { public ConnectPoint getDst() {
return dstConnectPoint; return dst;
} }
} }

View File

@ -1,14 +1,13 @@
package org.onlab.onos.net.intent; package org.onlab.onos.net.intent;
import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.base.MoreObjects;
import java.util.Objects;
import org.onlab.onos.net.ConnectPoint; import org.onlab.onos.net.ConnectPoint;
import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficSelector;
import org.onlab.onos.net.flow.TrafficTreatment; 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 point-to-point connectivity.
@ -23,15 +22,17 @@ public class PointToPointIntent extends ConnectivityIntent {
* ports. * ports.
* *
* @param id intent identifier * @param id intent identifier
* @param match traffic match * @param selector traffic selector
* @param action action * @param treatment treatment
* @param ingressPort ingress port * @param ingressPort ingress port
* @param egressPort egress port * @param egressPort egress port
* @throws NullPointerException if {@code ingressPort} or {@code egressPort} is null. * @throws NullPointerException if {@code ingressPort} or {@code egressPort} is null.
*/ */
public PointToPointIntent(IntentId id, TrafficSelector match, TrafficTreatment action, public PointToPointIntent(IntentId id, TrafficSelector selector,
ConnectPoint ingressPort, ConnectPoint egressPort) { TrafficTreatment treatment,
super(id, match, action); ConnectPoint ingressPort,
ConnectPoint egressPort) {
super(id, selector, treatment);
this.ingressPort = checkNotNull(ingressPort); this.ingressPort = checkNotNull(ingressPort);
this.egressPort = checkNotNull(egressPort); this.egressPort = checkNotNull(egressPort);
} }

View File

@ -1,17 +1,16 @@
package org.onlab.onos.net.intent; package org.onlab.onos.net.intent;
import static com.google.common.base.Preconditions.checkArgument; import com.google.common.base.MoreObjects;
import static com.google.common.base.Preconditions.checkNotNull; import com.google.common.collect.Sets;
import java.util.Objects;
import java.util.Set;
import org.onlab.onos.net.ConnectPoint; import org.onlab.onos.net.ConnectPoint;
import org.onlab.onos.net.flow.TrafficSelector; import org.onlab.onos.net.flow.TrafficSelector;
import org.onlab.onos.net.flow.TrafficTreatment; import org.onlab.onos.net.flow.TrafficTreatment;
import com.google.common.base.MoreObjects; import java.util.Objects;
import com.google.common.collect.Sets; 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. * 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. * Creates a new single-to-multi point connectivity intent.
* *
* @param id intent identifier * @param id intent identifier
* @param match traffic match * @param selector traffic selector
* @param action action * @param treatment treatment
* @param ingressPort port on which traffic will ingress * @param ingressPort port on which traffic will ingress
* @param egressPorts set of ports on which traffic will egress * @param egressPorts set of ports on which traffic will egress
* @throws NullPointerException if {@code ingressPort} or * @throws NullPointerException if {@code ingressPort} or
* {@code egressPorts} is null * {@code egressPorts} is null
* @throws IllegalArgumentException if the size of {@code egressPorts} is * @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, ConnectPoint ingressPort,
Set<ConnectPoint> egressPorts) { Set<ConnectPoint> egressPorts) {
super(id, match, action); super(id, selector, treatment);
checkNotNull(egressPorts); checkNotNull(egressPorts);
checkArgument(!egressPorts.isEmpty(), checkArgument(!egressPorts.isEmpty(),
"there should be at least one egress port"); "there should be at least one egress port");
this.ingressPort = checkNotNull(ingressPort); this.ingressPort = checkNotNull(ingressPort);
this.egressPorts = Sets.newHashSet(egressPorts); this.egressPorts = Sets.newHashSet(egressPorts);

View File

@ -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; package org.onlab.onos.net.intent;

View File

@ -3,6 +3,7 @@ package org.onlab.onos.net.provider;
import java.util.Objects; import java.util.Objects;
import static com.google.common.base.MoreObjects.toStringHelper; 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. * 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 { public class ProviderId {
/**
* Represents no provider ID.
*/
public static final ProviderId NONE = new ProviderId();
private final String scheme; private final String scheme;
private final String id; private final String id;
private final boolean ancillary; private final boolean ancillary;
// For serialization
private ProviderId() {
scheme = null;
id = null;
ancillary = false;
}
/** /**
* Creates a new primary provider identifier from the specified string. * Creates a new primary provider identifier from the specified string.
* The providers are expected to follow the reverse DNS convention, e.g. * The providers are expected to follow the reverse DNS convention, e.g.
@ -45,8 +58,8 @@ public class ProviderId {
* @param ancillary ancillary provider indicator * @param ancillary ancillary provider indicator
*/ */
public ProviderId(String scheme, String id, boolean ancillary) { public ProviderId(String scheme, String id, boolean ancillary) {
this.scheme = scheme; this.scheme = checkNotNull(scheme, "Scheme cannot be null");
this.id = id; this.id = checkNotNull(id, "ID cannot be null");
this.ancillary = ancillary; this.ancillary = ancillary;
} }

View File

@ -3,7 +3,7 @@ package org.onlab.onos.net.intent.impl;
import org.onlab.onos.net.intent.IntentId; 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}. * which uses {@link IdBlockAllocator}.
*/ */
public class IdBlockAllocatorBasedIntentIdGenerator extends AbstractBlockAllocatorBasedIdGenerator<IntentId> { public class IdBlockAllocatorBasedIntentIdGenerator extends AbstractBlockAllocatorBasedIdGenerator<IntentId> {

View File

@ -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; package org.onlab.onos.net.intent.impl;

View File

@ -0,0 +1,4 @@
/**
* Implementation of the cluster messaging mechanism.
*/
package org.onlab.onos.store.cluster.messaging.impl;

View File

@ -480,7 +480,7 @@
<group> <group>
<title>Core Subsystems</title> <title>Core Subsystems</title>
<packages> <packages>
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
</packages> </packages>
</group> </group>
<group> <group>