001/*
002 * (C) Copyright 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
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 *
016 * Contributors:
017 *     bstefanescu
018 *
019 * $Id: ExportedDocument.java 29029 2008-01-14 18:38:14Z ldoguin $
020 */
021
022package org.nuxeo.ecm.core.io;
023
024import java.util.Map;
025
026import org.dom4j.Document;
027import org.nuxeo.common.utils.Path;
028import org.nuxeo.ecm.core.api.Blob;
029import org.nuxeo.ecm.core.api.DocumentLocation;
030
031/**
032 * A representation for an exported document.
033 * <p>
034 * It contains all the information needed to restore document data and state.
035 *
036 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
037 */
038public interface ExportedDocument {
039
040    /**
041     * @return source DocumentLocation
042     */
043    DocumentLocation getSourceLocation();
044
045    Path getPath();
046
047    void setPath(Path path);
048
049    String getId();
050
051    void setId(String id);
052
053    String getType();
054
055    Document getDocument();
056
057    void setDocument(Document document);
058
059    Map<String, Blob> getBlobs();
060
061    void putBlob(String id, Blob blob);
062
063    Blob removeBlob(String id);
064
065    Blob getBlob(String id);
066
067    boolean hasExternalBlobs();
068
069    Map<String, Document> getDocuments();
070
071    Document getDocument(String id);
072
073    void putDocument(String id, Document doc);
074
075    Document removeDocument(String id);
076
077    /**
078     * The number of files describing the document.
079     */
080    int getFilesCount();
081
082}