001/** 002 * Copyright 2014 DuraSpace, Inc. 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.fcrepo.kernel.services; 017 018import javax.jcr.RepositoryException; 019import javax.jcr.Session; 020 021/** 022 * @author bbpennel 023 * @since Feb 19, 2014 024 */ 025public interface VersionService { 026 027 /** 028 * Explicitly creates a version for the nodes at each path provided. 029 * 030 * @param session the session in which the node resides 031 * @param absPath absolute paths to the node 032 * @throws RepositoryException 033 */ 034 String createVersion(Session session, String absPath) throws RepositoryException; 035 036 /** 037 * Reverts the node to the version identified by the label. This method 038 * will throw a PathNotFoundException if no version with the given label is 039 * found. 040 * 041 * @param session the session in which the node resides 042 * @param absPath the path to the node whose version is to be reverted 043 * @param label identifies the historic version 044 * @throws RepositoryException 045 */ 046 void revertToVersion(Session session, String absPath, String label) 047 throws RepositoryException; 048 049 /** 050 * Remove a version of a node. This method will throw a PathNotFoundException 051 * if no version with the given label is found. 052 * 053 * @param session the session in which the node resides 054 * @param absPath the path to the node whose version is to be removed 055 * @param label identifies the historic version by label or id 056 * @throws RepositoryException 057 */ 058 void removeVersion(Session session, String absPath, String label) 059 throws RepositoryException; 060 061}