001/*
002 * (C) Copyright 2013 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-2.1.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 *     Martin Pernollet
016 */
017
018package org.nuxeo.ecm.platform.groups.audit.service.acl.data;
019
020import org.nuxeo.ecm.platform.groups.audit.service.acl.Pair;
021
022import com.google.common.collect.Multimap;
023
024public class DocumentSummary {
025    public DocumentSummary(String title, int depth, boolean aclLockInheritance,
026            Multimap<String, Pair<String, Boolean>> userAcls) {
027        this.title = title;
028        this.depth = depth;
029        this.aclLockInheritance = aclLockInheritance;
030        this.userAcls = userAcls;
031    }
032
033    public DocumentSummary(String title, int depth, boolean aclLockInheritance,
034            Multimap<String, Pair<String, Boolean>> aclLocal, Multimap<String, Pair<String, Boolean>> aclInherited,
035            String path) {
036        this.title = title;
037        this.depth = depth;
038        this.aclLockInheritance = aclLockInheritance;
039        this.userAcls = aclLocal;
040        this.userAclsInherited = aclInherited;
041        this.path = path;
042    }
043
044    public DocumentSummary(String title, int depth, boolean aclLockInheritance,
045            Multimap<String, Pair<String, Boolean>> userAcls, String path) {
046        this.title = title;
047        this.depth = depth;
048        this.aclLockInheritance = aclLockInheritance;
049        this.userAcls = userAcls;
050        this.path = path;
051    }
052
053    public String getTitle() {
054        return title;
055    }
056
057    public int getDepth() {
058        return depth;
059    }
060
061    public String getPath() {
062        return path;
063    }
064
065    public boolean isAclLockInheritance() {
066        return aclLockInheritance;
067    }
068
069    public Multimap<String, Pair<String, Boolean>> getAclByUser() {
070        return userAcls;
071    }
072
073    public Multimap<String, Pair<String, Boolean>> getAclInheritedByUser() {
074        return userAclsInherited;
075    }
076
077    public void setAclInheritedByUser(Multimap<String, Pair<String, Boolean>> userAclsInherited) {
078        this.userAclsInherited = userAclsInherited;
079    }
080
081    protected String title;
082
083    protected String path;
084
085    protected int depth;
086
087    protected boolean aclLockInheritance;
088
089    protected Multimap<String, Pair<String, Boolean>> userAcls;
090
091    /** If we want to have different colors for inherited ACL, we can use this structure. */
092    protected Multimap<String, Pair<String, Boolean>> userAclsInherited;
093}