001/*
002 *  Copyright 2017 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.odf.catalog;
017
018import java.util.Map;
019
020import org.ametys.odf.program.Program;
021
022/**
023 * Interface to update contents after a copy of ODF catalog
024 *
025 */
026public interface CopyCatalogUpdater
027{
028    /**
029     * Update content during copy of a catalog. Implements this method when you do not need to wait for the full copy of the catalog.
030     * @param initialCatalogName the name of initial catalog
031     * @param newCatalogName the name of new catalog
032     * @param initialProgram the initial program
033     * @param createdProgram the created program
034     */
035    public void updateContent (String initialCatalogName, String newCatalogName, Program initialProgram, Program createdProgram);
036    
037    /**
038     * Update contents after the full copy of a catalog. Implements this method when you need to do some stuff when all contents have been copied.
039     * @param initialCatalogName the name of initial catalog
040     * @param newCatalogName the name of new catalog
041     * @param copiedPrograms the id of initial programs with their copied content
042     * @param copiedSubPrograms the id of initial subprograms with their copied content
043     * @param copiedContainers the id of initial containers with their copied content
044     * @param copiedCourseLists the id of initial course lists with their copied content
045     * @param copiedCourses the id of initial courses with their copied content
046     */
047    public void updateContents (String initialCatalogName, String newCatalogName, Map<String, String> copiedPrograms, Map<String, String> copiedSubPrograms, Map<String, String> copiedContainers, Map<String, String> copiedCourseLists, Map<String, String> copiedCourses);
048}