View Javadoc
1   package fr.ifremer.quadrige3.core.config;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 Client 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 fr.ifremer.quadrige3.core.action.*;
27  import fr.ifremer.quadrige3.synchro.action.ImportAction;
28  import org.nuiton.config.ConfigActionDef;
29  
30  /**
31   * <p>
32   * QuadrigeCoreConfigurationAction class.
33   * </p>
34   */
35  public enum QuadrigeCoreConfigurationAction implements ConfigActionDef {
36  
37      HELP(HelpAction.class.getName() + "#show", "Shows help", "-h", "--help"),
38  
39      DB_UPDATE(DatabaseUpdateSchemaAction.class.getName() + "#run", "Updates the schema", "--schema-update"),
40  
41      DB_STATUS(DatabaseStatusAction.class.getName() + "#run", "Show schema status", "--schema-status"),
42  
43      DB_DIFF(DatabaseDiffAction.class.getName() + "#run", "Show schema diff", "--schema-diff"),
44  
45      DB_CHANGELOG(DatabaseGenerateChangeLogAction.class.getName() + "#run", "Generate changelog file", "--schema-changelog"),
46  
47      NEW_EMPTY_DB(DatabaseNewDbAction.class.getName() + "#run", "Create new database", "--new-db"),
48  
49      IMPORT_REF(ImportAction.class.getName() + "#importReferential", "Import referential", "--import-ref"),
50  
51      IMPORT_DATA(ImportAction.class.getName() + "#importData", "Import data", "--import-data"),
52  
53      IMPORT_ALL(ImportAction.class.getName() + "#importReferentialAndData", "Import referential and data", "--import");
54  
55      public final String action;
56      public final String description;
57      public final String[] aliases;
58  
59      QuadrigeCoreConfigurationAction(String action, String description, String... aliases) {
60          this.action = action;
61          this.description = description;
62          this.aliases = aliases;
63      }
64  
65      /**
66       * {@inheritDoc}
67       */
68      @Override
69      public String getAction() {
70          return action;
71      }
72  
73      /**
74       * {@inheritDoc}
75       */
76      @Override
77      public String[] getAliases() {
78          return aliases;
79      }
80  
81      @Override
82      public String getDescription() {
83          return description;
84      }
85  
86  }