001/*
002 * (C) Copyright 2006-2010 Nuxeo SA (http://nuxeo.com/) and contributors.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the GNU Lesser General Public License
006 * (LGPL) version 2.1 which accompanies this distribution, and is available at
007 * http://www.gnu.org/licenses/lgpl.html
008 *
009 * This library is distributed in the hope that it will be useful,
010 * but WITHOUT ANY WARRANTY; without even the implied warranty of
011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
012 * Lesser General Public License for more details.
013 *
014 * Contributors:
015 *     Thierry Delprat
016 */
017package org.nuxeo.apidoc.snapshot;
018
019import java.io.IOException;
020import java.io.InputStream;
021import java.io.OutputStream;
022import java.util.List;
023import java.util.Map;
024
025import javax.servlet.http.HttpServletRequest;
026
027import org.nuxeo.apidoc.api.NuxeoArtifact;
028import org.nuxeo.ecm.core.api.CoreSession;
029import org.nuxeo.ecm.core.api.DocumentModel;
030
031public interface SnapshotManager {
032
033    void initSeamContext(HttpServletRequest request);
034
035    DistributionSnapshot getRuntimeSnapshot();
036
037    void addPersistentSnapshot(String key, DistributionSnapshot snapshot);
038
039    DistributionSnapshot getSnapshot(String key, CoreSession session);
040
041    List<DistributionSnapshot> readPersistentSnapshots(CoreSession session);
042
043    List<DistributionSnapshot> listPersistentSnapshots(CoreSession session);
044
045    Map<String, DistributionSnapshot> getPersistentSnapshots(CoreSession session);
046
047    List<String> getPersistentSnapshotNames(CoreSession session);
048
049    List<DistributionSnapshotDesc> getAvailableDistributions(CoreSession session);
050
051    List<String> getAvailableVersions(CoreSession session, NuxeoArtifact nxItem);
052
053    void exportSnapshot(CoreSession session, String key, OutputStream out) throws IOException;
054
055    void importSnapshot(CoreSession session, InputStream is) throws IOException;
056
057    DistributionSnapshot persistRuntimeSnapshot(CoreSession session);
058
059    DistributionSnapshot persistRuntimeSnapshot(CoreSession session, String name);
060
061    DistributionSnapshot persistRuntimeSnapshot(CoreSession session, String name, SnapshotFilter filter);
062
063    void validateImportedSnapshot(CoreSession session, String name, String version, String pathSegment, String title);
064
065    DocumentModel importTmpSnapshot(CoreSession session, InputStream is) throws IOException;
066
067}