001/*
002 * Copyright (c) 2006-2011 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 Eclipse Public License v1.0
006 * which accompanies this distribution, and is available at
007 * http://www.eclipse.org/legal/epl-v10.html
008 *
009 * Contributors:
010 *     Nuxeo - initial API and implementation
011 */
012
013package org.nuxeo.ecm.core.management.statuses;
014
015import java.io.Serializable;
016
017import org.nuxeo.common.xmap.annotation.XNode;
018import org.nuxeo.common.xmap.annotation.XObject;
019import org.nuxeo.ecm.core.management.api.AdministrativeStatus;
020
021@XObject("administrableService")
022public class AdministrableServiceDescriptor implements Serializable {
023
024    private static final long serialVersionUID = 1L;
025
026    @XNode("@id")
027    private String id;
028
029    @XNode("@name")
030    private String name;
031
032    @XNode("description")
033    private String description;
034
035    @XNode("label")
036    private String label;
037
038    @XNode("initialState")
039    private String initialState = AdministrativeStatus.ACTIVE;
040
041    public String getInitialState() {
042        return initialState;
043    }
044
045    public String getLabel() {
046        if (label == null) {
047            return "label." + getName();
048        }
049        return label;
050    }
051
052    public String getId() {
053        return id;
054    }
055
056    public String getDescription() {
057        if (description == null) {
058            return getName() + ".description";
059        }
060        return description;
061    }
062
063    public String getName() {
064        if (name == null) {
065            return id;
066        }
067        return name;
068    }
069}