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