+ public Status addStaticFlow(FlowConfig config) {
+ // Configuration object validation
+ Status status = config.validate(container);
+ if (!status.isSuccess()) {
+ log.warn("Invalid Configuration for flow {}. The failure is {}", config, status.getDescription());
+ String error = "Invalid Configuration (" + status.getDescription() + ")";
+ config.setStatus(error);
+ return new Status(StatusCode.BADREQUEST, error);
+ }
+ return addStaticFlowInternal(config, false);
+ }
+
+ /**
+ * Private method to add a static flow configuration which does not run any
+ * validation on the passed FlowConfig object. If restore is set to true,
+ * configuration is stored in configuration database regardless the
+ * installation on the network node was successful. This is useful at boot
+ * when static flows are present in startup configuration and are read
+ * before the switches connects.
+ *
+ * @param config
+ * The static flow configuration
+ * @param restore
+ * if true, the configuration is stored regardless the
+ * installation on the network node was successful
+ * @return The status of this request
+ */
+ private Status addStaticFlowInternal(FlowConfig config, boolean restore) {