// 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.
scanServerProxy.write_attribute(new DeviceAttribute(cat + "TimeOut",
errorStrategyTimeOut));
// Retry count.
scanServerProxy.write_attribute(new DeviceAttribute(cat + "RetryCount",
errorStrategyRetryCount));
// Retry time out.
scanServerProxy.write_attribute(new DeviceAttribute(cat
+ "RetryTimeOut", errorStrategyRetryTimeOut));
// Error strategy.
scanServerProxy.write_attribute(new DeviceAttribute(cat
+ "ErrorStrategy", errorStrategyType));
}
// Context validation error strategy.
scanServerProxy.write_attribute(new DeviceAttribute(
"contextValidationErrorStrategy", errorStrat
.getContextValidationStrategy().ordinal()));
scanServerProxy.write_attribute(new DeviceAttribute("contextValidation",
errorStrat.getContextValidationDevice()));
}
/* Hooks */
SetHooks(config.getScanAddOn(), scanServerProxy);