Adding javadoc to IntentInstaller.OperationContext
Change-Id: I9b37b4181d9130fccbed19bb13b3c1df0c0d0e0d
diff --git a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentInstaller.java b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentInstaller.java
index 1e569c4..8ea910b 100644
--- a/core/net/src/main/java/org/onosproject/net/intent/impl/IntentInstaller.java
+++ b/core/net/src/main/java/org/onosproject/net/intent/impl/IntentInstaller.java
@@ -187,13 +187,41 @@
private abstract class OperationContext {
protected Optional<IntentData> toUninstall;
protected Optional<IntentData> toInstall;
+ /**
+ * Implementation of {@link OperationContext} should call this on success.
+ */
protected Consumer<OperationContext> successConsumer;
+ /**
+ * Implementation of {@link OperationContext} should call this on error.
+ */
protected Consumer<OperationContext> errorConsumer;
+ /**
+ * Applies the Intents specified by
+ * {@link #prepareIntents(List, Direction)} call(s) prior to this call.
+ */
abstract void apply();
+ /**
+ * Returns error state of the context.
+ * <p>
+ * Used for error logging purpose.
+ * Returned Object should have reasonable toString() implementation.
+ * @return context state, describing current error state
+ */
abstract Object error();
+ /**
+ * Prepares Intent(s) to {@link #apply() apply} in this operation.
+ * <p>
+ * Intents specified by {@code intentsToApply} in a single call
+ * can be applied to the Devices in arbitrary order.
+ * But group of Intents specified in consecutive {@link #prepareIntents(List, Direction)}
+ * calls must be applied in order. (e.g., guarded by barrier)
+ *
+ * @param intentsToApply {@link Intent}s to apply
+ * @param direction of operation
+ */
abstract void prepareIntents(List<Intent> intentsToApply, Direction direction);
void prepare(Optional<IntentData> toUninstall, Optional<IntentData> toInstall,
@@ -311,6 +339,7 @@
FlowRuleOperations.Builder builder = FlowRuleOperations.builder();
FlowRuleOperationsContext flowRuleOperationsContext;
+ @Override
void apply() {
flowRuleOperationsContext = new FlowRuleOperationsContext() {
@Override