001/*
002 * Copyright (c) 2006-2011 Nuxeo SA (http://nuxeo.com/) and others.
003 *
004 * All rights reserved. This program and the accompanying materials
005 * are made available under the terms of the Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     bstefanescu
011 *
012 * $Id: ExportedDocument.java 29029 2008-01-14 18:38:14Z ldoguin $
013 */
014
015package org.nuxeo.ecm.core.io;
016
017import java.util.Map;
018
019import org.dom4j.Document;
020import org.nuxeo.common.utils.Path;
021import org.nuxeo.ecm.core.api.Blob;
022import org.nuxeo.ecm.core.api.DocumentLocation;
023
024/**
025 * A representation for an exported document.
026 * <p>
027 * It contains all the information needed to restore document data and state.
028 *
029 * @author <a href="mailto:bs@nuxeo.com">Bogdan Stefanescu</a>
030 */
031public interface ExportedDocument {
032
033    /**
034     * @return source DocumentLocation
035     */
036    DocumentLocation getSourceLocation();
037
038    Path getPath();
039
040    void setPath(Path path);
041
042    String getId();
043
044    void setId(String id);
045
046    String getType();
047
048    Document getDocument();
049
050    void setDocument(Document document);
051
052    Map<String, Blob> getBlobs();
053
054    void putBlob(String id, Blob blob);
055
056    Blob removeBlob(String id);
057
058    Blob getBlob(String id);
059
060    boolean hasExternalBlobs();
061
062    Map<String, Document> getDocuments();
063
064    Document getDocument(String id);
065
066    void putDocument(String id, Document doc);
067
068    Document removeDocument(String id);
069
070    /**
071     * The number of files describing the document.
072     */
073    int getFilesCount();
074
075}