001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Thierry Delprat
011 */
012package org.nuxeo.ecm.core.versioning;
013
014import java.util.List;
015
016import org.nuxeo.ecm.core.api.CoreSession;
017import org.nuxeo.ecm.core.event.impl.ShallowDocumentModel;
018
019/**
020 * Interface to be implemented by contributions to the orphanVersionRemovalFilter extension point.
021 * 
022 * @author <a href="mailto:tdelprat@nuxeo.com">Tiry</a>
023 */
024public interface OrphanVersionRemovalFilter {
025
026    /**
027     * This method will be called by the {@link OrphanVersionRemoverListener}. The method should return the List<String>
028     * versionUUIDs that can be deleted.
029     * <p>
030     * A "dummy" implementation will return the same list as the one received as parameter.
031     * 
032     * @param session the CoreSession
033     * @param deletedLiveDoc the Shallow DocumentModel that was deleted
034     * @param versionUUIDs the UUIDs of the versions associated to the deleted document
035     * @return the "filtred" list of versions that can be removed
036     */
037    List<String> getRemovableVersionIds(CoreSession session, ShallowDocumentModel deletedLiveDoc,
038            List<String> versionUUIDs);
039}