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.util.Collections; 020import java.util.Set; 021 022import org.nuxeo.ecm.core.api.IdRef; 023 024/** 025 * Data transfer object to fetch the list of references of synchronization roots for a given repo and user. 026 */ 027public class SynchronizationRoots { 028 029 protected final String repositoryName; 030 031 protected final Set<String> paths; 032 033 protected final Set<IdRef> refs; 034 035 public SynchronizationRoots(String repositoryName, Set<String> paths, Set<IdRef> refs) { 036 this.repositoryName = repositoryName; 037 this.paths = paths; 038 this.refs = refs; 039 } 040 041 public static final SynchronizationRoots getEmptyRoots(String repositoryName) { 042 Set<String> emptyPaths = Collections.emptySet(); 043 Set<IdRef> emptyRefs = Collections.emptySet(); 044 return new SynchronizationRoots(repositoryName, emptyPaths, emptyRefs); 045 } 046 047 public String getRepositoryName() { 048 return repositoryName; 049 } 050 051 public Set<String> getPaths() { 052 return paths; 053 } 054 055 public Set<IdRef> getRefs() { 056 return refs; 057 } 058 059}