Brian O'Connor

Adding @Beta to Intent API classes and interfaces

Change-Id: I02a3c1a678cb4e75b5bba9a33117a9dccb6fc0f5
Showing 43 changed files with 96 additions and 1 deletions
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import org.onosproject.core.ApplicationId;
......@@ -34,6 +35,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of connectivity intent for traffic matching some criteria.
*/
@Beta
public abstract class ConnectivityIntent extends Intent {
// TODO: other forms of intents should be considered for this family:
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
import org.onosproject.net.resource.link.LinkResourceService;
......@@ -24,6 +25,7 @@ import org.onosproject.net.resource.link.LinkResourceService;
* and determining the cost of traversing that link in the context of this
* constraint.
*/
@Beta
public interface Constraint {
// TODO: Consider separating cost vs viability.
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import org.onosproject.core.ApplicationId;
......@@ -31,6 +32,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
* An intent that enables to tell flow level operation.
* This instance holds a collection of flow rules that may be executed in parallel.
*/
@Beta
public class FlowRuleIntent extends Intent {
private final Collection<FlowRule> flowRules;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import org.onosproject.core.ApplicationId;
......@@ -29,6 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of end-station to end-station bidirectional connectivity.
*/
@Beta
public final class HostToHostIntent extends ConnectivityIntent {
private final HostId one;
......
......@@ -18,6 +18,7 @@ package org.onosproject.net.intent;
import java.util.Collection;
import java.util.Objects;
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.core.IdGenerator;
import org.onosproject.net.NetworkResource;
......@@ -32,6 +33,7 @@ import static com.google.common.base.Preconditions.checkState;
* Make sure that an Intent should be immutable when a new type is defined.
* </p>
*/
@Beta
public abstract class Intent {
private final IntentId id;
......
......@@ -15,11 +15,14 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import java.util.Collection;
/**
* Facade for receiving notifications from the intent batch service.
*/
@Beta
public interface IntentBatchDelegate {
/**
......
......@@ -15,11 +15,13 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.store.Timestamp;
/**
* Logical clock service that issues per-intent timestamps.
*/
@Beta
public interface IntentClockService {
/**
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.net.resource.link.LinkResourceAllocations;
import java.util.List;
......@@ -26,6 +27,7 @@ import java.util.Set;
*
* @param <T> the type of intent
*/
@Beta
public interface IntentCompiler<T extends Intent> {
/**
* Compiles the specified intent into other intents.
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import org.onosproject.cluster.NodeId;
......@@ -33,6 +34,7 @@ import static org.onosproject.net.intent.IntentState.*;
* A wrapper class that contains an intents, its state, and other metadata for
* internal use.
*/
@Beta
public class IntentData { //FIXME need to make this "immutable"
// manager should be able to mutate a local copy while processing
......
......@@ -15,11 +15,13 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.event.AbstractEvent;
/**
* A class to represent an intent related event.
*/
@Beta
public class IntentEvent extends AbstractEvent<IntentEvent.Type, Intent> {
public enum Type {
......
......@@ -15,9 +15,12 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
/**
* Represents an intent related error.
*/
@Beta
public class IntentException extends RuntimeException {
private static final long serialVersionUID = 1907263634145241319L;
......
......@@ -15,12 +15,15 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import java.util.Map;
/**
* Service for extending the capability of intent framework by
* adding additional compilers or/and installers.
*/
@Beta
public interface IntentExtensionService {
/**
* Registers the specified compiler for the given intent class.
......
......@@ -15,10 +15,13 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
/**
* Intent identifier suitable as an external key.
* <p>This class is immutable.</p>
*/
@Beta
public final class IntentId {
private final long value;
......
......@@ -15,10 +15,12 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.event.EventListener;
/**
* Listener for {@link IntentEvent intent events}.
*/
@Beta
public interface IntentListener extends EventListener<IntentEvent> {
}
......
......@@ -16,6 +16,8 @@
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import java.util.Objects;
import static com.google.common.base.MoreObjects.toStringHelper;
......@@ -24,6 +26,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of an intent-related operation, e.g. add, remove, replace.
*/
@Beta
public final class IntentOperation {
private final Type type;
......
......@@ -16,11 +16,14 @@
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import java.util.List;
/**
* Service for application submitting or withdrawing their intents.
*/
@Beta
public interface IntentService {
/**
* Submits an intent into the system.
......
......@@ -15,9 +15,12 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
/**
* Representation of the phases an intent may attain during its lifecycle.
*/
@Beta
public enum IntentState {
/**
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.store.Store;
import java.util.List;
......@@ -22,6 +23,7 @@ import java.util.List;
/**
* Manages inventory of end-station intents; not intended for direct use.
*/
@Beta
public interface IntentStore extends Store<IntentEvent, IntentStoreDelegate> {
/**
......
......@@ -15,11 +15,13 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.store.StoreDelegate;
/**
* Intent store delegate abstraction.
*/
@Beta
public interface IntentStoreDelegate extends StoreDelegate<IntentEvent> {
/**
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.hash.HashFunction;
import com.google.common.hash.Hashing;
import org.onosproject.core.ApplicationId;
......@@ -26,6 +27,7 @@ import java.util.Objects;
* Key class for Intents.
*/
// TODO maybe pull this up to utils
@Beta
public abstract class Key {
//TODO consider making this a HashCode object (worry about performance)
......
......@@ -18,6 +18,7 @@ package org.onosproject.net.intent;
import java.util.List;
import java.util.Set;
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.Link;
......@@ -31,6 +32,7 @@ import com.google.common.collect.ImmutableSet;
* Abstraction of a connectivity intent that is implemented by a set of path
* segments.
*/
@Beta
public final class LinkCollectionIntent extends ConnectivityIntent {
private final Set<Link> links;
......
......@@ -4,6 +4,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Optional;
import com.google.common.annotations.Beta;
import org.onlab.packet.MplsLabel;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
......@@ -19,6 +20,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of MPLS label-switched connectivity.
*/
@Beta
public final class MplsIntent extends ConnectivityIntent {
private final ConnectPoint ingressPoint;
......
......@@ -3,6 +3,7 @@ package org.onosproject.net.intent;
import java.util.List;
import java.util.Optional;
import com.google.common.annotations.Beta;
import org.onlab.packet.MplsLabel;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.Path;
......@@ -15,7 +16,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of explicit MPLS label-switched path.
*/
@Beta
public final class MplsPathIntent extends PathIntent {
private final Optional<MplsLabel> ingressLabel;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Sets;
......@@ -33,6 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of multiple source to single destination connectivity intent.
*/
@Beta
public final class MultiPointToSinglePointIntent extends ConnectivityIntent {
private final Set<ConnectPoint> ingressPoints;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
......@@ -28,6 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
* An optical layer intent for circuits between two OduClt ports.
* No traffic selector or traffic treatment are needed.
*/
@Beta
public class OpticalCircuitIntent extends Intent {
private final ConnectPoint src;
private final ConnectPoint dst;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
......@@ -28,6 +29,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
* An optical layer intent for connectivity between two OCh ports.
* No traffic selector or traffic treatment are needed.
*/
@Beta
public final class OpticalConnectivityIntent extends Intent {
private final ConnectPoint src;
private final ConnectPoint dst;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.OchSignal;
......@@ -26,6 +27,10 @@ import com.google.common.collect.ImmutableSet;
import static com.google.common.base.Preconditions.checkNotNull;
/**
* An optical layer intent with explicitly selected path.
*/
@Beta
public final class OpticalPathIntent extends Intent {
private final ConnectPoint src;
......
......@@ -15,12 +15,14 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.event.AbstractEvent;
/**
* Partition event.
*/
//TODO change String into a proper object type
@Beta
public class PartitionEvent extends AbstractEvent<PartitionEvent.Type, String> {
public enum Type {
......
......@@ -15,10 +15,12 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.event.EventListener;
/**
* Entity capable of receiving device partition-related events.
*/
@Beta
public interface PartitionEventListener extends EventListener<PartitionEvent> {
}
......
......@@ -15,11 +15,13 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import org.onosproject.cluster.NodeId;
/**
* Service for interacting with the partition-to-instance assignments.
*/
@Beta
public interface PartitionService {
/**
......
......@@ -17,6 +17,7 @@ package org.onosproject.net.intent;
import java.util.List;
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
......@@ -32,6 +33,7 @@ import static com.google.common.base.Preconditions.checkArgument;
/**
* Abstraction of explicitly path specified connectivity intent.
*/
@Beta
public class PathIntent extends ConnectivityIntent {
private final Path path;
......
......@@ -18,6 +18,7 @@ package org.onosproject.net.intent;
import java.util.Collections;
import java.util.List;
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.flow.TrafficSelector;
......@@ -31,6 +32,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of point-to-point connectivity.
*/
@Beta
public final class PointToPointIntent extends ConnectivityIntent {
private final ConnectPoint ingressPoint;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
......@@ -33,6 +34,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of single source, multiple destination connectivity intent.
*/
@Beta
public final class SinglePointToMultiPointIntent extends ConnectivityIntent {
private final ConnectPoint ingressPoint;
......
......@@ -18,6 +18,7 @@ package org.onosproject.net.intent;
import java.util.Collections;
import java.util.List;
import com.google.common.annotations.Beta;
import org.onosproject.core.ApplicationId;
import org.onosproject.net.ConnectPoint;
import org.onosproject.net.flow.TrafficSelector;
......@@ -30,6 +31,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Abstraction of bidirectional connectivity between two points in the network.
*/
@Beta
public final class TwoWayP2PIntent extends ConnectivityIntent {
private final ConnectPoint one;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import org.onosproject.net.Link;
import org.onosproject.net.resource.link.LinkResourceService;
......@@ -26,6 +27,7 @@ import static org.onosproject.net.AnnotationKeys.getAnnotatedValue;
/**
* Constraint that evaluates an arbitrary link annotated value is under the specified threshold.
*/
@Beta
public class AnnotationConstraint extends BooleanConstraint {
private final String key;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
import org.onosproject.net.intent.Constraint;
......@@ -27,6 +28,7 @@ import static com.google.common.base.MoreObjects.toStringHelper;
/**
* Constraint that serves as a request for asymmetric bi-directional path.
*/
@Beta
public class AsymmetricPathConstraint implements Constraint {
@Override
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import org.onosproject.net.Link;
import org.onosproject.net.resource.link.BandwidthResource;
import org.onosproject.net.resource.link.BandwidthResourceRequest;
......@@ -30,6 +31,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Constraint that evaluates links based on available bandwidths.
*/
@Beta
public class BandwidthConstraint extends BooleanConstraint {
private final BandwidthResource bandwidth;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
import org.onosproject.net.intent.Constraint;
......@@ -24,6 +25,7 @@ import org.onosproject.net.resource.link.LinkResourceService;
* Abstract base class for various constraints that evaluate link viability
* in a yes/no fashion.
*/
@Beta
public abstract class BooleanConstraint implements Constraint {
/**
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import org.onosproject.net.Link;
import org.onosproject.net.resource.link.LambdaResource;
import org.onosproject.net.resource.link.LinkResourceService;
......@@ -28,6 +29,7 @@ import static com.google.common.base.MoreObjects.toStringHelper;
/**
* Constraint that evaluates links based on available lambda.
*/
@Beta
public class LambdaConstraint extends BooleanConstraint {
private final LambdaResource lambda;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import org.onosproject.net.Link;
import org.onosproject.net.Path;
......@@ -31,6 +32,7 @@ import static org.onosproject.net.AnnotationKeys.getAnnotatedValue;
/**
* Constraint that evaluates the latency through a path.
*/
@Beta
public class LatencyConstraint implements Constraint {
private final Duration latency;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import com.google.common.collect.ImmutableSet;
import org.onosproject.net.Link;
import org.onosproject.net.resource.link.LinkResourceService;
......@@ -29,6 +30,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Constraint that evaluates links based on their type.
*/
@Beta
public class LinkTypeConstraint extends BooleanConstraint {
private final Set<Link.Type> types;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableSet;
import org.onosproject.net.DeviceId;
......@@ -28,6 +29,7 @@ import java.util.Set;
/**
* Constraint that evaluates elements not passed through.
*/
@Beta
public class ObstacleConstraint extends BooleanConstraint {
private final Set<DeviceId> obstacles;
......
......@@ -15,6 +15,7 @@
*/
package org.onosproject.net.intent.constraint;
import com.google.common.annotations.Beta;
import com.google.common.base.MoreObjects;
import com.google.common.collect.ImmutableList;
import org.onosproject.net.DeviceId;
......@@ -34,6 +35,7 @@ import static com.google.common.base.Preconditions.checkNotNull;
/**
* Constraint that evaluates elements passed through in order.
*/
@Beta
public class WaypointConstraint implements Constraint {
private final List<DeviceId> waypoints;
......