@Beta public abstract class Intent extends Object
Make sure that an Intent should be immutable when a new type is defined.
Modifier and Type | Class and Description |
---|---|
static class |
Intent.Builder
Abstract builder for intents.
|
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_INTENT_PRIORITY |
static int |
MAX_PRIORITY |
static int |
MIN_PRIORITY |
Modifier | Constructor and Description |
---|---|
protected |
Intent()
Constructor for serializer.
|
protected |
Intent(ApplicationId appId,
Key key,
Collection<NetworkResource> resources,
int priority,
ResourceGroup resourceGroup)
Creates a new intent.
|
Modifier and Type | Method and 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(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.
|
Collection<NetworkResource> |
resources()
Returns the collection of resources required for this intent.
|
static void |
unbindIdGenerator(IdGenerator oldIdGenerator)
Unbinds an id generator.
|
public static final int DEFAULT_INTENT_PRIORITY
public static final int MAX_PRIORITY
public static final int MIN_PRIORITY
protected Intent()
protected Intent(ApplicationId appId, Key key, Collection<NetworkResource> resources, int priority, ResourceGroup resourceGroup)
appId
- application identifierkey
- optional keyresources
- required network resources (optional)priority
- flow rule priorityresourceGroup
- the resource group for intentpublic IntentId id()
public ApplicationId appId()
public int priority()
public Collection<NetworkResource> resources()
public ResourceGroup resourceGroup()
public boolean isInstallable()
public static void bindIdGenerator(IdGenerator newIdGenerator)
newIdGenerator
- id generatorpublic static void unbindIdGenerator(IdGenerator oldIdGenerator)
oldIdGenerator
- the current id generator