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 *     Florent Guillaume
011 */
012
013package org.nuxeo.ecm.core.versioning;
014
015import org.nuxeo.ecm.core.api.CoreSession;
016import org.nuxeo.ecm.core.model.Document;
017import org.nuxeo.ecm.core.model.Session;
018
019/**
020 * Interface for the policy that decides which versions have to be removed when a working document is removed. This
021 * policy is called at the AbstractSession level.
022 *
023 * @author Florent Guillaume
024 */
025public interface VersionRemovalPolicy {
026
027    /**
028     * Removes the versions when a given working document is about to be removed.
029     *
030     * @param session the current session
031     * @param doc the document that is about to be removed
032     */
033    void removeVersions(Session session, Document doc, CoreSession coreSession);
034
035}