Examples of SalsaException


Examples of fr.soleil.salsa.exception.SalsaException

            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(getCurrentConfigPath());
            }
            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");
        }

        // Add StateListener
        if (currentConfigAtNewScan) {
            startListening();
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

                    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

            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(getCurrentConfigPath());
            }
            else if ((configPath != null) && (!configPath.isEmpty())
                    && (configPath.indexOf("/") > -1)) {
                setNewConfigPath(configPath);
            }
        }

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

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

        if (config == null) {
            configLoaded = false;
            notifyLoadingConfigFailed(configPath, salsaException);
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

            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()) {
            LOGGER.trace("newConfigPath={}", newConfigPath);
            LOGGER.trace("currentConfig={}", config);
            // Do not reload the config if the actual config is the same
            if ((config == null) || !config.getFullPath().equalsIgnoreCase(newConfigPath)) {
                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;
                    LOGGER.debug(e.getMessage());
                    LOGGER.debug("Stack trace", e);
                }
            }
        } else {
            String errorMessage = "configPath is null or empty";
            LOGGER.debug(errorMessage);
            salsaException = new SalsaException(errorMessage);
        }

        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
        for (final IDevice device : salsaDevice) {
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.