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