View Javadoc
1   package fr.ifremer.quadrige2.core.config;
2   
3   /*-
4    * #%L
5    * Quadrige2 Core :: Quadrige2 Server Core
6    * $Id:$
7    * $HeadURL:$
8    * %%
9    * Copyright (C) 2017 Ifremer
10   * %%
11   * This program is free software: you can redistribute it and/or modify
12   * it under the terms of the GNU Affero General Public License as published by
13   * the Free Software Foundation, either version 3 of the License, or
14   * (at your option) any later version.
15   * 
16   * This program is distributed in the hope that it will be useful,
17   * but WITHOUT ANY WARRANTY; without even the implied warranty of
18   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19   * GNU General Public License for more details.
20   * 
21   * You should have received a copy of the GNU Affero General Public License
22   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
23   * #L%
24   */
25  
26  import org.nuiton.config.ConfigActionDef;
27  
28  import fr.ifremer.quadrige2.core.action.DatabaseChangeLogAction;
29  import fr.ifremer.quadrige2.core.action.DatabaseDiffAction;
30  import fr.ifremer.quadrige2.core.action.DatabaseStatusAction;
31  import fr.ifremer.quadrige2.core.action.DatabaseUpdateAction;
32  import fr.ifremer.quadrige2.core.action.HelpAction;
33  
34  /**
35   * <p>
36   * Quadrige2CoreConfigurationAction class.
37   * </p>
38   */
39  public enum Quadrige2CoreConfigurationAction implements ConfigActionDef {
40  
41      HELP(HelpAction.class.getName() + "#show", "Shows help", "-h", "--help"),
42  
43      DB_UPDATE(DatabaseUpdateAction.class.getName() + "#run", "Updates the schema", "--schema-update"),
44  
45      DB_STATUS(DatabaseStatusAction.class.getName() + "#run", "Show schema status", "--schema-status"),
46  
47      DB_DIFF(DatabaseDiffAction.class.getName() + "#run", "Show schema diff", "--schema-diff"),
48  
49      DB_CHANGELOG(DatabaseChangeLogAction.class.getName() + "#run", "Generate changelog file", "--schema-changelog");
50  
51      public String action;
52      public String description;
53      public String[] aliases;
54  
55      Quadrige2CoreConfigurationAction(String action, String description, String... aliases) {
56          this.action = action;
57          this.description = description;
58          this.aliases = aliases;
59      }
60  
61      /**
62       * {@inheritDoc}
63       */
64      @Override
65      public String getAction() {
66          return action;
67      }
68  
69      /**
70       * {@inheritDoc}
71       */
72      @Override
73      public String[] getAliases() {
74          return aliases;
75      }
76  
77      @Override
78      public String getDescription() {
79          return description;
80      }
81  
82  }