Package fr.soleil.salsa.persistence.exception

Examples of fr.soleil.salsa.persistence.exception.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


        return root;
    }

    public void saveConfig(Configuration config) throws OutOfSyncException {
        if (config == null)
            throw new ScanConfigOutOfSyncException();

        // Checking if the configuration directory
        // has been deleted

        IDirectory directory = getDirectoryById(config.getDirectoryId());
        if (directory == null
                || !directory.getTimestamp().equals(config.getDirectory().getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        try {

            /* Insert */
 
View Full Code Here

            return;

        // V�rification de l'existence de la config
        Configuration configuration = getConfigById(config.getId());
        if (config == null || !config.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // V�rification si le r�pertoire de la config
        // a �t� supprim� entre temps ou pas
        IDirectory directory = getDirectoryById(config.getDirectoryId());
        if (directory == null
                || !directory.getTimestamp().equals(config.getDirectory().getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        String query = " UPDATE config SET name=? ";
        query += " , type=? ";
        query += " , data=? ";
View Full Code Here

        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

     * @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

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

        return root;
    }

    public void saveConfig(Configuration config) throws OutOfSyncException {
        if (config == null)
            throw new ScanConfigOutOfSyncException();

        // Checking if the configuration directory
        // has been deleted

        IDirectory directory = getDirectoryById(config.getDirectoryId());
        if (directory == null
                || !directory.getTimestamp().equals(
                        config.getDirectory().getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        try {

            /* Insert */
 
View Full Code Here

        // V�rification de l'existence de la config
        Configuration configuration = getConfigById(config.getId());
        if (config == null
                || !config.getTimestamp().equals(configuration.getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        // V�rification si le r�pertoire de la config
        // a �t� supprim� entre temps ou pas
        IDirectory directory = getDirectoryById(config.getDirectoryId());
        if (directory == null
                || !directory.getTimestamp().equals(
                        config.getDirectory().getTimestamp())) {
            throw new ScanConfigOutOfSyncException();
        }

        String query = " UPDATE config SET name=? ";
        query += " , type=? ";
        query += " , data=? ";
View Full Code Here

        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

     * @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

Related Classes of fr.soleil.salsa.persistence.exception.ScanConfigOutOfSyncException

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.