001/*
002 * (C) Copyright 2006-2012 Nuxeo SA (http://nuxeo.com/) and others.
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 *     Thomas Roger <troger@nuxeo.com>
016 */
017
018package org.nuxeo.ecm.quota;
019
020import org.nuxeo.common.xmap.annotation.XNode;
021import org.nuxeo.common.xmap.annotation.XObject;
022
023/**
024 * Descriptor object for registering {@link org.nuxeo.ecm.quota.QuotaStatsUpdater}s.
025 *
026 * @author <a href="mailto:troger@nuxeo.com">Thomas Roger</a>
027 * @since 5.5
028 */
029@XObject("quotaStatsUpdater")
030public class QuotaStatsUpdaterDescriptor {
031
032    @XNode("@name")
033    protected String name;
034
035    @XNode("@enabled")
036    protected boolean enabled = true;
037
038    @XNode("@class")
039    protected Class<? extends QuotaStatsUpdater> quotaStatsUpdaterClass;
040
041    @XNode("@label")
042    protected String label;
043
044    @XNode("@descriptionLabel")
045    protected String descriptionLabel;
046
047    public String getName() {
048        return name;
049    }
050
051    public void setName(String name) {
052        this.name = name;
053    }
054
055    public boolean isEnabled() {
056        return enabled;
057    }
058
059    public void setEnabled(boolean enabled) {
060        this.enabled = enabled;
061    }
062
063    public Class<? extends QuotaStatsUpdater> getQuotaStatsUpdaterClass() {
064        return quotaStatsUpdaterClass;
065    }
066
067    public void setQuotaStatsUpdaterClass(Class<? extends QuotaStatsUpdater> quotaStatsUpdaterClass) {
068        this.quotaStatsUpdaterClass = quotaStatsUpdaterClass;
069    }
070
071    public String getLabel() {
072        return label;
073    }
074
075    public void setLabel(String label) {
076        this.label = label;
077    }
078
079    public String getDescriptionLabel() {
080        return descriptionLabel;
081    }
082
083    public void setDescriptionLabel(String descriptionLabel) {
084        this.descriptionLabel = descriptionLabel;
085    }
086
087    @Override
088    public QuotaStatsUpdaterDescriptor clone() {
089        QuotaStatsUpdaterDescriptor clone = new QuotaStatsUpdaterDescriptor();
090        clone.setName(getName());
091        clone.setEnabled(isEnabled());
092        clone.setQuotaStatsUpdaterClass(getQuotaStatsUpdaterClass());
093        clone.setLabel(getLabel());
094        clone.setDescriptionLabel(getDescriptionLabel());
095        return clone;
096    }
097
098}