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 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 classIntent.BuilderAbstract builder for intents.
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_INTENT_PRIORITYstatic intMAX_PRIORITYstatic intMIN_PRIORITY
-
Constructor Summary
Constructors Modifier Constructor Description protectedIntent()Constructor for serializer.protectedIntent(ApplicationId appId, Key key, 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 ApplicationIdappId()Returns the identifier of the application that requested the intent.static voidbindIdGenerator(IdGenerator newIdGenerator)Binds an id generator for unique intent id generation.booleanequals(Object obj)inthashCode()IntentIdid()Returns the intent object identifier.booleanisInstallable()Indicates whether or not the intent is installable.Keykey()Returns the key to identify an "Intent".intpriority()Returns the priority of the intent.ResourceGroupresourceGroup()Returns the resource group for this intent.Collection<NetworkResource>resources()Returns the collection of resources required for this intent.static voidunbindIdGenerator(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, 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 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
-
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
-
-