Examples of IErrorStrategy


Examples of fr.soleil.salsa.entity.IErrorStrategy

                    // 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()));

                        String value = errorStrat.getContextValidationDevice();
                        if (value != null && value.isEmpty()) {
                            scanServerProxy.write_attribute(new DeviceAttribute(
                                    "contextValidation", value));
                        }
                    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.