001/*
002 * This library is part of OpenCms -
003 * the Open Source Content Management System
004 *
005 * Copyright (C) Alkacon Software (http://www.alkacon.com)
006 *
007 * This library is free software; you can redistribute it and/or
008 * modify it under the terms of the GNU Lesser General Public
009 * License as published by the Free Software Foundation; either
010 * version 2.1 of the License, or (at your option) any later version.
011 *
012 * This library is distributed in the hope that it will be useful,
013 * but WITHOUT ANY WARRANTY; without even the implied warranty of
014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
015 * Lesser General Public License for more details.
016 *
017 * For further information about Alkacon Software, please see the
018 * company website: http://www.alkacon.com
019 *
020 * For further information about OpenCms, please see the
021 * project website: http://www.opencms.org
022 *
023 * You should have received a copy of the GNU Lesser General Public
024 * License along with this library; if not, write to the Free Software
025 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
026 */
027
028package org.opencms.ade.galleries;
029
030import org.opencms.util.CmsUUID;
031
032import java.io.Serializable;
033import java.util.Set;
034
035/**
036 * The tree open state of a gallery tree tab.<p>
037 */
038public class CmsTreeOpenState implements Serializable {
039
040    /** The serial version id. */
041    private static final long serialVersionUID = 1L;
042
043    /** The set of structure ids belonging to opened tree items. */
044    private Set<CmsUUID> m_openItems;
045
046    /** The site root. */
047    private String m_siteRoot;
048
049    /** The time stamp. */
050    private long m_timestamp;
051
052    /** The tree name. */
053    private String m_treeName;
054
055    /**
056     * Creates a new tree open state instance.<p>
057     *
058     * @param treeName the tree name
059     * @param siteRoot the site root
060     * @param openItems the ids of the open tree entries
061     */
062    public CmsTreeOpenState(String treeName, String siteRoot, Set<CmsUUID> openItems) {
063
064        m_treeName = treeName;
065        m_siteRoot = siteRoot;
066        m_openItems = openItems;
067        m_timestamp = System.currentTimeMillis();
068    }
069
070    /**
071     * Gets the set of structure ids of resources corresponding to opened tree entries.<p>
072     *
073     * @return the set of structure ids of open tree entries
074     */
075    public Set<CmsUUID> getOpenItems() {
076
077        return m_openItems;
078    }
079
080    /**
081     * Gets the site root.<p>
082     *
083     * @return the site root
084     */
085    public String getSiteRoot() {
086
087        return m_siteRoot;
088    }
089
090    /**
091     * Gets the time stamp.<p>
092     *
093     * @return the time stamps
094     */
095    public long getTimestamp() {
096
097        return m_timestamp;
098    }
099
100    /**
101     * Gets the tree name.<p>
102     *
103     * @return the tree name
104     */
105    public String getTreeName() {
106
107        return m_treeName;
108    }
109
110}