Changing error message in case of no pipeliner
Change-Id: I45f5708385b8dd5ff025f2c6821ce2d4a6ecec3f
diff --git a/core/api/src/main/java/org/onosproject/net/flowobjective/ObjectiveError.java b/core/api/src/main/java/org/onosproject/net/flowobjective/ObjectiveError.java
index fd159d7..8ae192d 100644
--- a/core/api/src/main/java/org/onosproject/net/flowobjective/ObjectiveError.java
+++ b/core/api/src/main/java/org/onosproject/net/flowobjective/ObjectiveError.java
@@ -54,6 +54,11 @@
BADPARAMS,
/**
+ * The device has no pipeline driver to install objectives.
+ */
+ NOPIPELINER,
+
+ /**
* An unknown error occurred.
*/
UNKNOWN
diff --git a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
index 54ee2a6..d82b6f7 100644
--- a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/FlowObjectiveManager.java
@@ -180,6 +180,7 @@
} else {
pipeliner.filter((FilteringObjective) objective);
}
+ //Attempts to check if pipeliner is null for retry attempts
} else if (numAttempts < INSTALL_RETRY_ATTEMPTS) {
Thread.sleep(INSTALL_RETRY_INTERVAL);
executorService.submit(new ObjectiveInstaller(deviceId, objective, numAttempts + 1));
@@ -187,8 +188,9 @@
// Otherwise we've tried a few times and failed, report an
// error back to the user.
objective.context().ifPresent(
- c -> c.onError(objective, ObjectiveError.DEVICEMISSING));
+ c -> c.onError(objective, ObjectiveError.NOPIPELINER));
}
+ //Excpetion thrown
} catch (Exception e) {
log.warn("Exception while installing flow objective", e);
}
diff --git a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/composition/FlowObjectiveCompositionManager.java b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/composition/FlowObjectiveCompositionManager.java
index ed8f4e4..a64b976 100644
--- a/core/net/src/main/java/org/onosproject/net/flowobjective/impl/composition/FlowObjectiveCompositionManager.java
+++ b/core/net/src/main/java/org/onosproject/net/flowobjective/impl/composition/FlowObjectiveCompositionManager.java
@@ -206,7 +206,7 @@
// Otherwise we've tried a few times and failed, report an
// error back to the user.
objective.context().ifPresent(
- c -> c.onError(objective, ObjectiveError.DEVICEMISSING));
+ c -> c.onError(objective, ObjectiveError.NOPIPELINER));
}
} catch (Exception e) {
log.warn("Exception while installing flow objective", e);