View Javadoc
1   package fr.ifremer.quadrige3.batch.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 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.batch.action.HelpAction;
27  import fr.ifremer.quadrige3.core.action.*;
28  import org.nuiton.config.ConfigActionDef;
29  
30  /**
31   * <p>
32   * BatchesServerConfigurationAction class.
33   * </p>
34   */
35  public enum BatchesServerConfigurationAction implements ConfigActionDef {
36  
37      HELP(HelpAction.class.getName() + "#show", "Shows help", "-h", "--help"),
38  
39      DB_CREATE(DatabaseCreateSchemaAction.class.getName() + "#run", "Create new database", "--schema-create"),
40  
41      DB_UPDATE(DatabaseUpdateSchemaAction.class.getName() + "#run", "Updates the schema", "--schema-update"),
42  
43      DB_STATUS(DatabaseStatusAction.class.getName() + "#run", "Show schema status", "--schema-status"),
44  
45      DB_DIFF(DatabaseDiffAction.class.getName() + "#run", "Show schema diff", "--schema-diff"),
46  
47      DB_CHANGELOG(DatabaseGenerateChangeLogAction.class.getName() + "#run", "Generate changelog file", "--schema-changelog");
48  
49      public final String action;
50      public final String description;
51      public final String[] aliases;
52  
53      BatchesServerConfigurationAction(String action, String description, String... aliases) {
54          this.action = action;
55          this.description = description;
56          this.aliases = aliases;
57      }
58  
59      /**
60       * {@inheritDoc}
61       */
62      @Override
63      public String getAction() {
64          return action;
65      }
66  
67      /**
68       * {@inheritDoc}
69       */
70      @Override
71      public String[] getAliases() {
72          return aliases;
73      }
74  
75      @Override
76      public String getDescription() {
77          return description;
78      }
79  
80  }