Package org.onosproject.net.intent
Class IntentInstallationContext
- java.lang.Object
 - 
- org.onosproject.net.intent.IntentInstallationContext
 
 
- 
public class IntentInstallationContext extends java.lang.ObjectInstallation context for a high level Intent. Records pending and error operation contexts of installable Intents for the high level Intent. 
- 
- 
Constructor Summary
Constructors Constructor Description IntentInstallationContext(IntentData toUninstall, IntentData toInstall)Creates an Intent installation context by given information. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddErrorContext(IntentOperationContext context)Adds an error context.voidaddPendingContext(IntentOperationContext context)Adds a pending context.java.util.Set<IntentOperationContext>errorContexts()Retrieves the error contexts.booleanisPendingContextsEmpty()Check if pending context is empty.java.util.Set<IntentOperationContext>pendingContexts()Retrieves the pending contexts.voidremovePendingContext(IntentOperationContext context)Removes a pending operation context.java.util.Optional<IntentData>toInstall()Retrieves the Intent data which to be installed.java.lang.StringtoString()java.util.Optional<IntentData>toUninstall()Retrieves the Intent data which to be uninstalled. 
 - 
 
- 
- 
Constructor Detail
- 
IntentInstallationContext
public IntentInstallationContext(IntentData toUninstall, IntentData toInstall)
Creates an Intent installation context by given information.- Parameters:
 toUninstall- the Intent to uninstalltoInstall- the Intent to install
 
 - 
 
- 
Method Detail
- 
removePendingContext
public void removePendingContext(IntentOperationContext context)
Removes a pending operation context.- Parameters:
 context- the operation context to be added
 
- 
addPendingContext
public void addPendingContext(IntentOperationContext context)
Adds a pending context.- Parameters:
 context- the operation context to be added
 
- 
addErrorContext
public void addErrorContext(IntentOperationContext context)
Adds an error context.- Parameters:
 context- the error context to be added.
 
- 
pendingContexts
public java.util.Set<IntentOperationContext> pendingContexts()
Retrieves the pending contexts.- Returns:
 - the pending contexts
 
 
- 
errorContexts
public java.util.Set<IntentOperationContext> errorContexts()
Retrieves the error contexts.- Returns:
 - the error contexts
 
 
- 
isPendingContextsEmpty
public boolean isPendingContextsEmpty()
Check if pending context is empty.- Returns:
 - true if pending contexts is empty; false otherwise
 
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
- 
toUninstall
public java.util.Optional<IntentData> toUninstall()
Retrieves the Intent data which to be uninstalled.- Returns:
 - the Intent data; empty value if not exists
 
 
- 
toInstall
public java.util.Optional<IntentData> toInstall()
Retrieves the Intent data which to be installed.- Returns:
 - the Intent data; empty value if not exists
 
 
 - 
 
 -