/*
 * This file is part of VoltDB.
 * Copyright (C) 2008-2014 VoltDB Inc.
 */

package org.voltdb.catalog;

public class FilteredCatalogDiffEngine extends CatalogDiffEngine {

    public FilteredCatalogDiffEngine(Catalog prev, Catalog next) {
        super(prev, next);
        // TODO Auto-generated constructor stub
    }

    /**
     * @return true if this change may be ignored
     */
    @Override
    protected boolean checkModifyIgnoreList(final CatalogType suspect,
                                            final CatalogType prevType,
                                            final String field)
    {
        if (super.checkModifyIgnoreList(suspect, prevType, field))
            return true;
        if (suspect instanceof Database) {
            if ("schema".equals(field))
                // Since Epoch dates and other possible fields may be different
                // Schema will also be different
                return true;
        }
        return false;
    }

    /**
     * @return true if this addition may be ignored
     */
    @Override
    protected boolean checkAddIgnoreList(final CatalogType suspect)
    {
        if (super.checkAddIgnoreList(suspect)) {
            return true;
        }
        return false;
    }

    /**
     * @return true if this delete may be ignored
     */
    @Override
    protected boolean checkDeleteIgnoreList(final CatalogType prevType,
                                            final CatalogType newlyChildlessParent,
                                            final String mapName,
                                            final String name)
    {
        if (super.checkDeleteIgnoreList(prevType, newlyChildlessParent, mapName, name)) {
            return true;
        }
        if ("connectors".equals(mapName)) {
            // Export specific catalog elements do not affect the DDL
            return true;
        }
        return false;
    }

}

@@ -1,13 +1,10 @@
 /*
-%0A *
  This fi
@@ -64,16 +64,824 @@
 DB Inc.%0A
+ *%0A * This program is free software: you can redistribute it and/or modify%0A * it under the terms of the GNU Affero General Public License as%0A * published by the Free Software Foundation, either version 3 of the%0A * License, or (at your option) any later version.%0A *%0A * This program is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A * GNU Affero General Public License for more details.%0A *%0A * You should have received a copy of the GNU Affero General Public License%0A * along with VoltDB.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A */%0A%0A/* WARNING: THIS FILE IS AUTO-GENERATED%0A            DO NOT MODIFY THIS SOURCE%0A            ALL CHANGES MUST BE MADE IN THE CATALOG GENERATOR
  */%0A%0Apac

Add Copyright and AutoGen warning comments to file.