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