Package org.onosproject.net.intent
Class Intent
- java.lang.Object
-
- org.onosproject.net.intent.Intent
-
- Direct Known Subclasses:
ConnectivityIntent
,DomainIntent
,FlowObjectiveIntent
,FlowRuleIntent
,OpticalCircuitIntent
,OpticalConnectivityIntent
,OpticalOduIntent
,OpticalPathIntent
,ProtectionEndpointIntent
@Beta public abstract class Intent extends java.lang.Object
Abstraction of an application level intent.Make sure that an Intent should be immutable when a new type is defined.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Intent.Builder
Abstract builder for intents.
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_INTENT_PRIORITY
static int
MAX_PRIORITY
static int
MIN_PRIORITY
-
Constructor Summary
Constructors Modifier Constructor Description protected
Intent()
Constructor for serializer.protected
Intent(ApplicationId appId, Key key, java.util.Collection<NetworkResource> resources, int priority, ResourceGroup resourceGroup)
Creates a new intent.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ApplicationId
appId()
Returns the identifier of the application that requested the intent.static void
bindIdGenerator(IdGenerator newIdGenerator)
Binds an id generator for unique intent id generation.boolean
equals(java.lang.Object obj)
int
hashCode()
IntentId
id()
Returns the intent object identifier.boolean
isInstallable()
Indicates whether or not the intent is installable.Key
key()
Returns the key to identify an "Intent".int
priority()
Returns the priority of the intent.ResourceGroup
resourceGroup()
Returns the resource group for this intent.java.util.Collection<NetworkResource>
resources()
Returns the collection of resources required for this intent.static void
unbindIdGenerator(IdGenerator oldIdGenerator)
Unbinds an id generator.
-
-
-
Field Detail
-
DEFAULT_INTENT_PRIORITY
public static final int DEFAULT_INTENT_PRIORITY
- See Also:
- Constant Field Values
-
MAX_PRIORITY
public static final int MAX_PRIORITY
- See Also:
- Constant Field Values
-
MIN_PRIORITY
public static final int MIN_PRIORITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Intent
protected Intent()
Constructor for serializer.
-
Intent
protected Intent(ApplicationId appId, Key key, java.util.Collection<NetworkResource> resources, int priority, ResourceGroup resourceGroup)
Creates a new intent.- Parameters:
appId
- application identifierkey
- optional keyresources
- required network resources (optional)priority
- flow rule priorityresourceGroup
- the resource group for intent
-
-
Method Detail
-
id
public IntentId id()
Returns the intent object identifier.- Returns:
- intent fingerprint
-
appId
public ApplicationId appId()
Returns the identifier of the application that requested the intent.- Returns:
- application identifier
-
priority
public int priority()
Returns the priority of the intent.- Returns:
- intent priority
-
resources
public java.util.Collection<NetworkResource> resources()
Returns the collection of resources required for this intent.- Returns:
- collection of resources; may be null
-
resourceGroup
public ResourceGroup resourceGroup()
Returns the resource group for this intent.- Returns:
- the resource group; may be null
-
isInstallable
public boolean isInstallable()
Indicates whether or not the intent is installable.- Returns:
- true if installable
-
hashCode
public final int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public final boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
bindIdGenerator
public static void bindIdGenerator(IdGenerator newIdGenerator)
Binds an id generator for unique intent id generation. Note: A generator cannot be bound if there is already a generator bound.- Parameters:
newIdGenerator
- id generator
-
unbindIdGenerator
public static void unbindIdGenerator(IdGenerator oldIdGenerator)
Unbinds an id generator. Note: The caller must provide the old id generator to succeed.- Parameters:
oldIdGenerator
- the current id generator
-
-