001/*
002 * (C) Copyright 2006-2009 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 *     Nuxeo
016 */
017
018package org.nuxeo.ecm.platform.publisher.remoting.marshaling.basic;
019
020import org.nuxeo.ecm.core.api.DocumentRef;
021import org.nuxeo.ecm.platform.publisher.api.PublishedDocument;
022
023/**
024 * Java implementation for the marshalled {@link PublishedDocument}.
025 *
026 * @author tiry
027 */
028public class BasicPublishedDocument implements PublishedDocument {
029
030    private DocumentRef docRef;
031
032    private String repositoryName;
033
034    private String serverName;
035
036    private String versionLabel;
037
038    private String path;
039
040    private String parentPath;
041
042    private boolean isPending;
043
044    private static final long serialVersionUID = 1L;
045
046    public BasicPublishedDocument(DocumentRef docRef, String repositoryName, String serverName, String versionLabel,
047            String path, String parentPath, boolean isPending) {
048        this.docRef = docRef;
049        this.repositoryName = repositoryName;
050        this.serverName = serverName;
051        this.versionLabel = versionLabel;
052        this.path = path;
053        this.parentPath = parentPath;
054        this.isPending = isPending;
055    }
056
057    public DocumentRef getSourceDocumentRef() {
058        return docRef;
059    }
060
061    public String getSourceRepositoryName() {
062        return repositoryName;
063    }
064
065    public String getSourceServer() {
066        return serverName;
067    }
068
069    public String getSourceVersionLabel() {
070        return versionLabel;
071    }
072
073    public String getPath() {
074        return path;
075    }
076
077    public String getParentPath() {
078        return parentPath;
079    }
080
081    public boolean isPending() {
082        return isPending;
083    }
084
085    public Type getType() {
086        return Type.REMOTE;
087    }
088
089}