001/*
002 * (C) Copyright 2012 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 *     Antoine Taillefer <ataillefer@nuxeo.com>
016 */
017package org.nuxeo.drive.service;
018
019import java.io.Serializable;
020import java.util.Collections;
021import java.util.Set;
022
023import org.nuxeo.ecm.core.api.IdRef;
024
025/**
026 * Data transfer object to fetch the list of references of synchronization roots for a given repo and user.
027 */
028public class SynchronizationRoots implements Serializable {
029
030    private static final long serialVersionUID = 5975197559729672670L;
031
032    protected final String repositoryName;
033
034    protected final Set<String> paths;
035
036    protected final Set<IdRef> refs;
037
038    public SynchronizationRoots(String repositoryName, Set<String> paths, Set<IdRef> refs) {
039        this.repositoryName = repositoryName;
040        this.paths = paths;
041        this.refs = refs;
042    }
043
044    public static final SynchronizationRoots getEmptyRoots(String repositoryName) {
045        Set<String> emptyPaths = Collections.emptySet();
046        Set<IdRef> emptyRefs = Collections.emptySet();
047        return new SynchronizationRoots(repositoryName, emptyPaths, emptyRefs);
048    }
049
050    public String getRepositoryName() {
051        return repositoryName;
052    }
053
054    public Set<String> getPaths() {
055        return paths;
056    }
057
058    public Set<IdRef> getRefs() {
059        return refs;
060    }
061
062}