Package org.onosproject.net.intent
Interface IntentService
-
- All Superinterfaces:
ListenerService<IntentEvent,IntentListener>
@Beta public interface IntentService extends ListenerService<IntentEvent,IntentListener>
Service for application submitting or withdrawing their intents.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addPending(IntentData intentData)
Adds an intent data object to the pending map for processing.java.util.List<Intent>
getInstallableIntents(Key intentKey)
Returns the list of the installable events associated with the specified top-level intent.Intent
getIntent(Key key)
Fetches an intent based on its key.long
getIntentCount()
Returns the number of intents currently in the system.java.lang.Iterable<IntentData>
getIntentData()
Returns an iterable of intent data objects currently in the system.java.lang.Iterable<Intent>
getIntents()
Returns an iterable of intents currently in the system.IntentState
getIntentState(Key intentKey)
Retrieves the state of an intent by its identifier.java.lang.Iterable<Intent>
getPending()
Returns the list of intent requests pending processing.boolean
isLocal(Key intentKey)
Signifies whether the local node is responsible for processing the given intent key.void
purge(Intent intent)
Purges a specific intent from the system if it is FAILED or WITHDRAWN.void
submit(Intent intent)
Submits an intent into the system.void
withdraw(Intent intent)
Withdraws an intent from the system.-
Methods inherited from interface org.onosproject.event.ListenerService
addListener, removeListener
-
-
-
-
Method Detail
-
submit
void submit(Intent intent)
Submits an intent into the system.This is an asynchronous request meaning that any compiling or installation activities may be done at later time.
- Parameters:
intent
- intent to be submitted
-
withdraw
void withdraw(Intent intent)
Withdraws an intent from the system.This is an asynchronous request meaning that the environment may be affected at later time.
- Parameters:
intent
- intent to be withdrawn
-
purge
void purge(Intent intent)
Purges a specific intent from the system if it is FAILED or WITHDRAWN. Otherwise, the intent remains in its current state.- Parameters:
intent
- intent to purge
-
getIntent
Intent getIntent(Key key)
Fetches an intent based on its key.- Parameters:
key
- key of the intent- Returns:
- intent object if the key is found, null otherwise
-
getIntents
java.lang.Iterable<Intent> getIntents()
Returns an iterable of intents currently in the system.- Returns:
- set of intents
-
addPending
void addPending(IntentData intentData)
Adds an intent data object to the pending map for processing.This method is intended to only be called by core components, not applications.
- Parameters:
intentData
- intent data to be added to pending map
-
getIntentData
java.lang.Iterable<IntentData> getIntentData()
Returns an iterable of intent data objects currently in the system.- Returns:
- set of intent data objects
-
getIntentCount
long getIntentCount()
Returns the number of intents currently in the system.- Returns:
- number of intents
-
getIntentState
IntentState getIntentState(Key intentKey)
Retrieves the state of an intent by its identifier.- Parameters:
intentKey
- intent identifier- Returns:
- the intent state or null if one with the given identifier is not found
-
getInstallableIntents
java.util.List<Intent> getInstallableIntents(Key intentKey)
Returns the list of the installable events associated with the specified top-level intent.- Parameters:
intentKey
- top-level intent identifier- Returns:
- compiled installable intents
-
isLocal
boolean isLocal(Key intentKey)
Signifies whether the local node is responsible for processing the given intent key.- Parameters:
intentKey
- intent key to check- Returns:
- true if the local node is responsible for the intent key, otherwise false
-
getPending
java.lang.Iterable<Intent> getPending()
Returns the list of intent requests pending processing.- Returns:
- intents pending processing
-
-