001/*
002 * ModeShape (http://www.modeshape.org)
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.modeshape.web.server;
017
018import javax.jcr.Repository;
019import javax.jcr.Session;
020import org.modeshape.web.shared.BackupParams;
021import org.modeshape.web.shared.RemoteException;
022import org.modeshape.web.shared.RestoreParams;
023
024/**
025 * @author kulikov
026 */
027public interface LRepository {
028    /**
029     * Name of the repository.
030     * 
031     * @return the repository name
032     */
033    public String name();
034
035    /**
036     * Provides access to the original repository.
037     * 
038     * @return original JCR repository;
039     */
040    public Repository repository();
041
042    /**
043     * Gets list of available workspaces.
044     * 
045     * @return the names of the workspaces that are available
046     */
047    public String[] getWorkspaces();
048
049    /**
050     * Gets session to the given workspace.
051     * 
052     * @param workspace the name of the workspace.
053     * @return jcr session object.
054     * @throws RemoteException if there is a problem talking to a remote service
055     */
056    public Session session( String workspace ) throws RemoteException;
057
058    /**
059     * Backup repository.
060     * 
061     * @param name
062     * @param options
063     * @throws RemoteException 
064     */
065    public void backup( String name, BackupParams options ) throws RemoteException;
066
067    /**
068     * Restore repository.
069     * 
070     * @param name
071     * @param options
072     * @throws RemoteException 
073     */
074    public void restore( String name, RestoreParams options ) throws RemoteException;
075
076}