001package fr.ifremer.adagio.core.config;
002
003/*
004 * #%L
005 * SIH-Adagio :: Shared
006 * $Id:$
007 * $HeadURL:$
008 * %%
009 * Copyright (C) 2012 - 2014 Ifremer
010 * %%
011 * This program is free software: you can redistribute it and/or modify
012 * it under the terms of the GNU Affero General Public License as published by
013 * the Free Software Foundation, either version 3 of the License, or
014 * (at your option) any later version.
015 * 
016 * This program is distributed in the hope that it will be useful,
017 * but WITHOUT ANY WARRANTY; without even the implied warranty of
018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
019 * GNU General Public License for more details.
020 * 
021 * You should have received a copy of the GNU Affero General Public License
022 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
023 * #L%
024 */
025
026import org.nuiton.config.ConfigActionDef;
027
028import fr.ifremer.adagio.core.action.AllegroCoreNewEmptyDbAction;
029import fr.ifremer.adagio.core.action.AllegroCoreHelpAction;
030import fr.ifremer.adagio.core.action.AllegroCoreImportReferentialAction;
031import fr.ifremer.adagio.core.action.DatabaseChangeLogAction;
032import fr.ifremer.adagio.core.action.DatabaseDiffAction;
033import fr.ifremer.adagio.core.action.DatabaseStatusAction;
034import fr.ifremer.adagio.core.action.DatabaseUpdateAction;
035
036public enum AllegroCoreConfigurationAction implements ConfigActionDef {
037
038    HELP(AllegroCoreHelpAction.class.getName() + "#show", "-h", "--help"),
039
040    DB_UPDATE(DatabaseUpdateAction.class.getName() + "#run", "--schema-update"),
041
042    DB_STATUS(DatabaseStatusAction.class.getName() + "#run", "--schema-status"),
043
044    DB_DIFF(DatabaseDiffAction.class.getName() + "#run", "--schema-diff"),
045
046    DB_CHANGELOG(DatabaseChangeLogAction.class.getName() + "#run", "--schema-changelog"),
047
048    DB_IMPORT_REF(AllegroCoreImportReferentialAction.class.getName() + "#run", "--import-ref"),
049
050    NEW_EMPTY_DB(AllegroCoreNewEmptyDbAction.class.getName() + "#run", "--new-db");
051
052    public String action;
053    public String[] aliases;
054
055    private AllegroCoreConfigurationAction(String action, String... aliases) {
056        this.action = action;
057        this.aliases = aliases;
058    }
059
060    @Override
061    public String getAction() {
062        return action;
063    }
064
065    @Override
066    public String[] getAliases() {
067        return aliases;
068    }
069}