}
// Error strategies.
if ((config.getScanAddOn() != null) && (config.getScanAddOn().getErrorStrategy() != null)) {
IErrorStrategy errorStrat = config.getScanAddOn().getErrorStrategy();
IErrorStrategyItem[] categoriesESI = new IErrorStrategyItem[] {
errorStrat.getActuatorsErrorStrategy(), errorStrat.getSensorsErrorStrategy(),
errorStrat.getTimebasesErrorStrategy(), errorStrat.getHooksErrorStrategy() };
String[] categoriesStr = new String[] { "actuators", "sensors", "timebases", "hooks" };
for (int i = 0; i < categoriesStr.length; i++) {
String cat = categoriesStr[i];
IErrorStrategyItem esi = categoriesESI[i];
double errorStrategyTimeOut = esi.getTimeOut();
int errorStrategyRetryCount = esi.getRetryCount();
double errorStrategyRetryTimeOut = esi.getTimeBetweenRetries();
int errorStrategyType = esi.getStrategy().ordinal();
// Time out.
String catAttribute = cat + "TimeOut";
actionName = writeAttributeLog(catAttribute, String.valueOf(errorStrategyTimeOut));
scanServerProxy.write_attribute(new DeviceAttribute(catAttribute, errorStrategyTimeOut));
// Retry count.
catAttribute = cat + "RetryCount";
actionName = writeAttributeLog(catAttribute, String.valueOf(errorStrategyRetryCount));
scanServerProxy.write_attribute(new DeviceAttribute(catAttribute, errorStrategyRetryCount));
// Retry time out.
catAttribute = cat + "RetryTimeOut";
actionName = writeAttributeLog(catAttribute, String.valueOf(errorStrategyRetryTimeOut));
scanServerProxy.write_attribute(new DeviceAttribute(catAttribute, errorStrategyRetryTimeOut));
// Error strategy.
catAttribute = cat + "ErrorStrategy";
actionName = writeAttributeLog(catAttribute, String.valueOf(errorStrategyType));
scanServerProxy.write_attribute(new DeviceAttribute(catAttribute, errorStrategyType));
}
// Context validation error strategy.
int erreurStrategyValue = errorStrat.getContextValidationStrategy().ordinal();
actionName = writeAttributeLog(CurrentScanDataModel.CONTEXT_VALIDATION_STRATEGY,
String.valueOf(erreurStrategyValue));
setAttribute(CurrentScanDataModel.CONTEXT_VALIDATION_STRATEGY, erreurStrategyValue, false);
String value = errorStrat.getContextValidationDevice();
if ((value != null) && !value.trim().isEmpty()) {
actionName = writeAttributeLog(CurrentScanDataModel.CONTEXT_VALIDATION, value);
setAttribute(CurrentScanDataModel.CONTEXT_VALIDATION, value, false);
}
}