Package fr.soleil.salsa.entity

Examples of fr.soleil.salsa.entity.IErrorStrategy


            IScanAddOns scanAddOns = newConfig.getScanAddOn();
            if (scanAddOns == null) {
                scanAddOns = new ScanAddOnImp();
            }

            IErrorStrategy errorStrategy = scanAddOns.getErrorStrategy();
            String contextValidation = CurrentConfigurationParser.readContextValidation(scanServer);
            if ((contextValidation != null) && !contextValidation.isEmpty()) {
                errorStrategy.setContextValidationDevice(contextValidation);
                int strategy = CurrentConfigurationParser.readErrorStrategy(scanServer,
                        CurrentScanDataModel.CONTEXT_VALIDATION);
                errorStrategy.setContextValidationStrategy(getErrorStrategyType(strategy));
            }

            String[] categoriesStr = new String[] { "actuators", "sensors", "timebases", "hooks" };
            IErrorStrategyItem[] categoriesESI = new IErrorStrategyItem[] { errorStrategy.getActuatorsErrorStrategy(),
                    errorStrategy.getSensorsErrorStrategy(), errorStrategy.getTimebasesErrorStrategy(),
                    errorStrategy.getHooksErrorStrategy() };
            String cat = null;
            IErrorStrategyItem item = null;
            for (int i = 0; i < categoriesStr.length; i++) {
                cat = categoriesStr[i];
                item = categoriesESI[i];
View Full Code Here


                }

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

                    String value = errorStrat.getContextValidationDevice();
                    if (value != null && !value.trim().isEmpty()) {
                        actionName = writeAttributeLog(CurrentScanDataModel.CONTEXT_VALIDATION, value);
                        setAttribute(CurrentScanDataModel.CONTEXT_VALIDATION, value);
                    }
                }
View Full Code Here

TOP

Related Classes of fr.soleil.salsa.entity.IErrorStrategy

Copyright © 2018 www.massapicom. 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.