View Javadoc
1   package net.sumaris.core.config;
2   
3   /*-
4    * #%L
5    * Quadrige3 Core :: Quadrige3 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 General Public License as
13   * published by the Free Software Foundation, either version 3 of the
14   * License, or (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 General Public
22   * License along with this program.  If not, see
23   * <http://www.gnu.org/licenses/gpl-3.0.html>.
24   * #L%
25   */
26  
27  import net.sumaris.core.action.DatabaseGenerateChangeLogAction;
28  import net.sumaris.core.action.DatabaseCreateSchemaAction;
29  import net.sumaris.core.action.DatabaseUpdateSchemaAction;
30  import net.sumaris.core.action.HelpAction;
31  import org.nuiton.config.ConfigActionDef;
32  
33  /**
34   * <p>
35   * BatchesServerConfigurationAction class.
36   * </p>
37   */
38  public enum SumarisCoreConfigurationAction implements ConfigActionDef {
39  
40      HELP(HelpAction.class.getName() + "#show", "Shows help", "-h", "--help"),
41  
42      DB_CREATE(DatabaseCreateSchemaAction.class.getName() + "#run", "Create new database", "--schema-create"),
43  
44      DB_UPDATE_SCHEMA(DatabaseUpdateSchemaAction.class.getName() + "#run", "Update an existing database", "--schema-update"),
45  
46      DB_CHANGELOG(DatabaseGenerateChangeLogAction.class.getName() + "#run", "Update an existing database", "--schema-changelog");
47  
48      public final String action;
49      public final String description;
50      public final String[] aliases;
51  
52      SumarisCoreConfigurationAction(String action, String description, String... aliases) {
53          this.action = action;
54          this.description = description;
55          this.aliases = aliases;
56      }
57  
58      /**
59       * {@inheritDoc}
60       */
61      @Override
62      public String getAction() {
63          return action;
64      }
65  
66      /**
67       * {@inheritDoc}
68       */
69      @Override
70      public String[] getAliases() {
71          return aliases;
72      }
73  
74      @Override
75      public String getDescription() {
76          return description;
77      }
78  
79  }