001/*
002 * Copyright 2015 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.api.services;
017
018import java.io.File;
019import java.util.Collection;
020
021import javax.jcr.Session;
022
023/**
024 * @author bbpennel
025 * @since Feb 20, 2014
026 */
027public interface RepositoryService {
028
029    /**
030     * Calculate the total size of all the binary properties in the repository
031     *
032     * @return size in bytes
033     */
034    Long getRepositorySize();
035
036    /**
037     * Calculate the number of objects in the repository
038     *
039     * @return number of objects in the repository
040     */
041    Long getRepositoryObjectCount();
042
043    /**
044     * This method backups up a running repository
045     *
046     * @param session the session
047     * @param backupDirectory the backup directory
048     * @return problems
049     */
050    Collection<Throwable> backupRepository(Session session, File backupDirectory);
051
052    /**
053     * This methods restores the repository from a backup
054     *
055     * @param session the session
056     * @param backupDirectory the backup directory
057     * @return problems
058     */
059    Collection<Throwable> restoreRepository(Session session, File backupDirectory);
060
061}