+ @Override
+ public boolean isStaleMarkingEnabled() {
+ return staleMarkingEnabled;
+ }
+
+ @Override
+ public int getReconciliationRetryCount() {
+ return reconciliationRetryCount;
+ }
+
+ @Override
+ public FlowNodeConnectorInventoryTranslatorImpl getFlowNodeConnectorInventoryTranslatorImpl() {
+ return flowNodeConnectorInventoryTranslatorImpl;
+ }
+
+ @Override
+ public boolean isBundleBasedReconciliationEnabled() {
+ return isBundleBasedReconciliationEnabled;
+ }
+
+ @Override
+ public boolean isNodeOwner(InstanceIdentifier<FlowCapableNode> ident) {
+ return Objects.nonNull(ident) && deviceMastershipManager.isDeviceMastered(ident.firstKeyOf(Node.class).getId());
+ }
+
+ @VisibleForTesting
+ public void setDeviceMastershipManager(final DeviceMastershipManager deviceMastershipManager) {
+ this.deviceMastershipManager = deviceMastershipManager;
+ }
+
+ @Override
+ public void onPropertyChanged(@Nonnull final String propertyName, @Nonnull final String propertyValue) {
+ Optional.ofNullable(ForwardingRulesProperty.forValue(propertyName)).ifPresent(forwardingRulesProperty -> {
+ switch (forwardingRulesProperty) {
+ case DISABLE_RECONCILIATION:
+ disableReconciliation = Boolean.valueOf(propertyValue);
+ break;
+ case STALE_MARKING_ENABLED:
+ staleMarkingEnabled = Boolean.valueOf(propertyValue);
+ break;
+ case RECONCILIATION_RETRY_COUNT:
+ reconciliationRetryCount = Integer.parseInt(propertyValue);
+ break;
+ case BUNDLE_BASED_RECONCILIATION_ENABLED:
+ isBundleBasedReconciliationEnabled = Boolean.valueOf(propertyValue);
+ break;
+ default:
+ LOG.warn("No forwarding rule property found.");
+ break;
+ }
+ });
+ }
+}