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;
019
020import java.util.HashMap;
021import java.util.Map;
022
023public class ReportLayout {
024    protected Map<String, Integer> userColumn;
025
026    protected Map<Pair<String, String>, Integer> userAclColumn;
027
028    public ReportLayout() {
029        reset();
030    }
031
032    public void reset() {
033        userColumn = new HashMap<String, Integer>();
034        userAclColumn = new HashMap<Pair<String, String>, Integer>();
035    }
036
037    /** Store the user column */
038    public void setUserColumn(int column, String userOrGroup) {
039        userColumn.put(userOrGroup, column);
040    }
041
042    /** Return the user column */
043    public int getUserColumn(String user) {
044        return userColumn.get(user);
045    }
046
047    public void setUserAclColumn(int column, Pair<String, String> userAcl) {
048        userAclColumn.put(userAcl, column);
049    }
050
051    /** Return the user column */
052    public int getUserAclColumn(Pair<String, String> userAcl) {
053        return userAclColumn.get(userAcl);
054    }
055}