Examples of ScanConfigOutOfSyncException


Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

        configResultat = getConfigById(configuration.getId());

        // Case when the entity is NULL
        if (configResultat == null
                || !configResultat.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // delete the config
        deleteConfigNoCommitAux(configuration);
    }
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

     * @param config The {@link Configuration} to save
     * @throws OutOfSyncException If the {@link Configuration} is <code>null</code> or out of
     *             synchronization with database
     */
    public void saveConfig(Configuration config) throws OutOfSyncException {
        ScanConfigOutOfSyncException exception = null;
        if (config == null) {
            exception = new ScanConfigOutOfSyncException("Can't save a null configuration");
        }
        else {
            Configuration configuration = getConfigById(config.getId());
            boolean newConfig = configuration == null;
            // Checking if the configuration is out of synchronization
            if (!newConfig && !config.getTimestamp().equals(configuration.getTimestamp())) {
                exception = new ScanConfigOutOfSyncException();
            }
            else {
                // Checking if the configuration directory has been deleted
                IDirectory directory = getDirectoryById(config.getDirectoryId(), false);
                if (directory == null
                        || !directory.getTimestamp().equals(config.getDirectory().getTimestamp())) {
                    exception = new ScanConfigOutOfSyncException();
                }
                else {
                    StringBuilder queryBuilder = new StringBuilder();
                    if (newConfig) {
                        queryBuilder.append("INSERT INTO config (name, type, data, directoryid) ");
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

        configResultat = getConfigById(configuration.getId());

        // Case when the entity is NULL
        if (configResultat == null
                || !configResultat.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // delete the config
        deleteConfigNoCommitAux(configuration);
    }
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

     * @param config The {@link Configuration} to save
     * @throws OutOfSyncException If the {@link Configuration} is <code>null</code> or out of
     *             synchronization with database
     */
    public void saveConfig(Configuration config) throws OutOfSyncException {
        ScanConfigOutOfSyncException exception = null;
        if (config == null) {
            exception = new ScanConfigOutOfSyncException("Can't save a null configuration");
        }
        else {
            Configuration configuration = getConfigById(config.getId());
            boolean newConfig = configuration == null;
            // Checking if the configuration is out of synchronization
            if (!newConfig && !config.getTimestamp().equals(configuration.getTimestamp())) {
                exception = new ScanConfigOutOfSyncException();
            }
            else {
                // Checking if the configuration directory has been deleted
                IDirectory directory = getDirectoryById(config.getDirectoryId(), false);
                if (directory == null
                        || !directory.getTimestamp().equals(config.getDirectory().getTimestamp())) {
                    exception = new ScanConfigOutOfSyncException();
                }
                else {
                    StringBuilder queryBuilder = new StringBuilder();
                    if (newConfig) {
                        queryBuilder.append("INSERT INTO config (name, type, data, directoryid) ");
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

        configResultat = getConfigById(configuration.getId());

        // Case when the entity is NULL
        if (configResultat == null
                || !configResultat.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // delete the config
        deleteConfigNoCommitAux(configuration);
    }
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

     * @param forceSaving = true ignore OutOfSync Error
     * @throws OutOfSyncException If the {@link Configuration} is <code>null</code> or out of
     *             synchronization with database
     */
    public void saveConfig(Configuration config, boolean forceSaving) throws OutOfSyncException {
        ScanConfigOutOfSyncException exception = null;
        if (config == null) {
            exception = new ScanConfigOutOfSyncException("Can't save a null configuration");
        }
        else {
            Configuration configuration = getConfigById(config.getId());
            boolean newConfig = (configuration == null);

            // If forceSaving = false test the synchronization
            if (!forceSaving) {
                // Modification of the timestamp when saved a new configuration
                Timestamp oldConfigTSP = config.getTimestamp();

                // Checking if the configuration is out of synchronization
                if (!newConfig && oldConfigTSP.before(configuration.getTimestamp())) {
                    exception = new ScanConfigOutOfSyncException(
                            "The configuration has been changed by other");
                }
            }

            if (exception == null) {
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

        configResultat = getConfigById(configuration.getId());

        // Case when the entity is NULL
        if (configResultat == null
                || !configResultat.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // delete the config
        deleteConfigNoCommitAux(configuration);
    }
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

     * @param forceSaving = true ignore OutOfSync Error
     * @throws OutOfSyncException If the {@link Configuration} is <code>null</code> or out of
     *             synchronization with database
     */
    public void saveConfig(Configuration config, boolean forceSaving) throws OutOfSyncException {
        ScanConfigOutOfSyncException exception = null;
        if (config == null) {
            exception = new ScanConfigOutOfSyncException("Can't save a null configuration");
        }
        else {
            Configuration configuration = getConfigById(config.getId());
            boolean newConfig = (configuration == null);

            // If forceSaving = false test the synchronization
            if (!forceSaving) {
                // Modification of the timestamp when saved a new configuration
                Timestamp oldConfigTSP = config.getTimestamp();

                // Checking if the configuration is out of synchronization
                if (!newConfig && oldConfigTSP.before(configuration.getTimestamp())) {
                    exception = new ScanConfigOutOfSyncException(
                            "The configuration has been changed by other");
                }
            }

            if (exception == null) {
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

        configResultat = getConfigById(configuration.getId());

        // Case when the entity is NULL
        if (configResultat == null
                || !configResultat.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // delete the config
        deleteConfigNoCommitAux(configuration);
    }
View Full Code Here

Examples of fr.soleil.salsa.exception.persistence.ScanConfigOutOfSyncException

     * @param config The {@link Configuration} to save
     * @throws OutOfSyncException If the {@link Configuration} is <code>null</code> or out of
     *             synchronization with database
     */
    public void saveConfig(Configuration config) throws OutOfSyncException {
        ScanConfigOutOfSyncException exception = null;
        if (config == null) {
            exception = new ScanConfigOutOfSyncException("Can't save a null configuration");
        }
        else {
            Configuration configuration = getConfigById(config.getId());
            boolean newConfig = configuration == null;
            // Checking if the configuration is out of synchronization
            if (!newConfig && !config.getTimestamp().equals(configuration.getTimestamp())) {
                exception = new ScanConfigOutOfSyncException();
            }
            else {
                // Checking if the configuration directory has been deleted
                IDirectory directory = getDirectoryById(config.getDirectoryId(), false);
                if (directory == null
                        || !directory.getTimestamp().equals(config.getDirectory().getTimestamp())) {
                    exception = new ScanConfigOutOfSyncException();
                }
                else {
                    StringBuilder queryBuilder = new StringBuilder();
                    if (newConfig) {
                        queryBuilder.append("INSERT INTO config (name, type, data, directoryid) ");
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.