Examples of SalsaException


Examples of fr.soleil.salsa.exception.SalsaException

            configPath = config.getFullPath();
            configLoaded = true;
            notifyLoadingConfigSucceed(config);
        } else {
            configLoaded = false;
            notifyLoadingConfigFailed("no config", new SalsaException("configPath is null or empty"));
        }

    }
View Full Code Here

Examples of fr.soleil.salsa.exception.SalsaException

    @Override
    public void loadConfig() {
        load = true;
        IConfig<?> newConfig = null;
        SalsaException salsaException = null;

        if (currentConfigAtLoad || currentConfigAtNewScan) {
            String currentConfigPath = getCurrentConfigPath();
            if ((currentConfigPath != null) && (!currentConfigPath.isEmpty()) && (currentConfigPath.indexOf("/") > -1)) {
                setNewConfigPath(currentConfigPath);
            } else if ((configPath != null) && (!configPath.isEmpty()) && (configPath.indexOf("/") > -1)) {
                setNewConfigPath(configPath);
            }
        }

        if (newConfigPath != null && !newConfigPath.isEmpty()) {
            // System.out.println("newConfigPath=" + newConfigPath);
            // System.out.println("config=" + config);
            // Do not reload the config if the actual config is the same
            if (config == null || !config.getFullPath().equalsIgnoreCase(newConfigPath)) {
                // System.out.println("create config");
                try {
                    newConfig = SalsaAPI.getConfigByPath(newConfigPath, reloadConfigAtRead);
                    if (newConfig != null) {
                        config = newConfig;
                    } else {
                        salsaException = new SalsaException("unknown error for loading " + newConfigPath);
                    }

                    if (config == null) {
                        configLoaded = false;
                        notifyLoadingConfigFailed(configPath, salsaException);
                    } else {
                        configLoaded = true;
                        notifyLoadingConfigSucceed(config);
                    }
                } catch (SalsaException e) {
                    salsaException = e;
                    e.printStackTrace();

                }
            }
        } else {
            salsaException = new SalsaException("configPath is null or empty");
        }

        if (newConfig == null) {
            configLoaded = false;
        }
View Full Code Here

Examples of fr.soleil.salsa.exception.SalsaException

                    found = true;
                }
            }
            // this deviceName is not in salsa configuration
            if (!found) {
                throw new SalsaException(Arrays.toString(userDeviceList) + " is not valid " + name
                        + " list");
            }
        }

        // enable deviceList and disable other actuators
View Full Code Here

Examples of fr.soleil.salsa.exception.SalsaException

        if (userDeviceList != null) {
            IDevice device = null;
            for (final String deviceName : userDeviceList) {
                device = getDevice(deviceName, deviceList);
                if (device == null) {
                    throw new SalsaException(name + ": " + deviceName + " not found in configuration.");
                } else {
                    device.setEnabled(true);
                }
            }
        }
View Full Code Here

Examples of fr.soleil.salsa.exception.SalsaException

                    found = true;
                }
            }
            // this deviceName is not in salsa configuration
            if (!found) {
                throw new SalsaException(Arrays.toString(userDeviceList) + " is not valid " + name
                        + " list");
            }
        }

        // enable deviceList and disable other actuators
View Full Code Here

Examples of fr.soleil.salsa.exception.SalsaException

        if (userDeviceList != null) {
            IDevice device = null;
            for (final String deviceName : userDeviceList) {
                device = getDevice(deviceName, deviceList);
                if (device == null) {
                    throw new SalsaException(deviceName + " is a not valid " + name);
                } else {
                    device.setEnabled(true);
                }
            }
        }
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.