/*
 * JBoss, Home of Professional Open Source.
 * See the COPYRIGHT.txt file distributed with this work for information
 * regarding copyright ownership.  Some portions may be licensed
 * to Red Hat, Inc. under one or more contributor license agreements.
 * 
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 * 
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 * 
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301 USA.
 * Modified by
 * @author  Data Virtuality GmbH
 * @date    $Date$
 *  
 */

package org.teiid.metadata;


import org.teiid.translator.ExecutionFactory;
import org.teiid.translator.TranslatorException;

/**
 * A hook for externalizing view, procedure, and other metadata.
 */
// EXTENSION
// ISSUE: DVCORE-2441
// FIXED BY: Roman Pedchenko
// DATE: 2014.10.26
// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
// public interface MetadataRepository<F,C> {
public abstract class MetadataRepository<F,C> {
// END EXTENSION

	/**
	 * Loads the schema information for the vdb for the given schemaName. Loads table, procedures, functions, indexes etc.
	 * @param factory
	 * @param executionFactory may be null if loading a virtual source
	 * @param connectionFactory may be null if source is not available
	 * @return
	 * @throws TranslatorException to indicate a recoverable error, otherwise a RuntimeException
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void loadMetadata(MetadataFactory factory, ExecutionFactory<F, C> executionFactory, F connectionFactory) throws TranslatorException;
	public abstract void loadMetadata(MetadataFactory factory, ExecutionFactory<F, C> executionFactory, F connectionFactory) throws TranslatorException;
	// END EXTENSION

	/**
	 * Call back function, when "alter view" definition is called 
	 * @param vdbName
	 * @param vdbVersion
	 * @param table
	 * @param viewDefinition
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setViewDefinition(String vdbName, int vdbVersion, Table table, String viewDefinition);
	public void setViewDefinition(String vdbName, int vdbVersion, Table table, String viewDefinition) {}
	// END EXTENSION
	
	/**
	 * Call back function, when "alter trigger" is called 
	 * @param vdbName
	 * @param vdbVersion
	 * @param table
	 * @param triggerOperation
	 * @param triggerDefinition
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setInsteadOfTriggerDefinition(String vdbName, int vdbVersion, Table table, Table.TriggerEvent triggerOperation, String triggerDefinition);
	public void setInsteadOfTriggerDefinition(String vdbName, int vdbVersion, Table table, Table.TriggerEvent triggerOperation, String triggerDefinition) {}
	// END EXTENSION
	
	/**
	 * Callback function, when "alter trigger" is called to enable or disable a trigger
	 * @param vdbName
	 * @param vdbVersion
	 * @param table
	 * @param triggerOperation
	 * @param enabled
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setInsteadOfTriggerEnabled(String vdbName, int vdbVersion, Table table, Table.TriggerEvent triggerOperation, boolean enabled);
	public void setInsteadOfTriggerEnabled(String vdbName, int vdbVersion, Table table, Table.TriggerEvent triggerOperation, boolean enabled) {}
	// END EXTENSION
	
	
	/**
	 * Call back function, when "alter procedure" is called to set the procedure definition
	 * @param vdbName
	 * @param vdbVersion
	 * @param procedure
	 * @param procedureDefinition
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setProcedureDefinition(String vdbName, int vdbVersion, Procedure procedure, String procedureDefinition);
	public void setProcedureDefinition(String vdbName, int vdbVersion, Procedure procedure, String procedureDefinition) {}
	// END EXTENSION

	public void setFunctionDefinition(String vdbName, int vdbVersion, FunctionMethod function, String functionDefinition) {}
	
	/**
	 * Set the {@link TableStats} for the given table
	 * @param vdbName
	 * @param vdbVersion
	 * @param table
	 * @param tableStats
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setTableStats(String vdbName, int vdbVersion, Table table, TableStats tableStats);
	public void setTableStats(String vdbName, int vdbVersion, Table table, TableStats tableStats) {}
	// END EXTENSION
	
	
	/**
	 * Set the {@link ColumnStats} for a given column
	 * @param vdbName
	 * @param vdbVersion
	 * @param column
	 * @param columnStats
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setColumnStats(String vdbName, int vdbVersion, Column column, ColumnStats columnStats);
	public void setColumnStats(String vdbName, int vdbVersion, Column column, ColumnStats columnStats) {}
	// END EXTENSION
	
	/**
	 * Set an extension metadata property for a given record.
	 * @param vdbName
	 * @param vdbVersion
	 * @param record
	 * @param name
	 * @param value
	 */
	// EXTENSION
	// ISSUE: DVCORE-2441
	// FIXED BY: Roman Pedchenko
	// DATE: 2014.10.26
	// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
	// void setProperty(String vdbName, int vdbVersion, AbstractMetadataRecord record, String name, String value);
	public void setProperty(String vdbName, int vdbVersion, AbstractMetadataRecord record, String name, String value) {}

    // END EXTENSION
	
// EXTENSION
// ISSUE: DVCORE-2441
// FIXED BY: Roman Pedchenko
// DATE: 2014.10.26
// ADOPTED FROM: https://issues.jboss.org/browse/TEIID-2235, 2661, 2178, 2297
//     /**
//      * Next repository in the repository chain. The implementation contract of this method dictates if this method is set then
//      * Implementation class must delegete the call to 'next' instance after it is done with the processing of the call.
//      * @param next
//      */
//     void setNext(MetadataRepository<?, ?> next);
// END EXTENSION
}
