DBVIEW
src/org/dbview/addons/input/utils/mysql/CliOptions.java
00001 /*
00002         DbView - Graph Visualization
00003     Copyright (C) 2012  Denis BEURIVE
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 /**
00020  * @author Denis Beurive
00021  */
00022 
00023 package org.dbview.addons.input.utils.mysql;
00024 
00025 import org.dbview.utils.args4j.*;
00026 import org.kohsuke.args4j.Option;
00027 
00028 /**
00029  * @class CliOptions
00030  *
00031  * This class defines the <i>command line options container</i> associated to the MySql odd-on.
00032  * @remark See Args4j. The command line options are declared in a class. We call this class the <i>command line options container</i>
00033  * @author Denis Beurive
00034  */
00035 public class CliOptions extends OptionContainer
00036 {
00037     /** Command line option that represents the name of the name of the host that runs the MySql server. */
00038     final static public String HOST        = "-host";
00039 
00040     /** Command line option that represents the name of the MySql user. */
00041     final static public String USER        = "-user";
00042 
00043     /** Command line option that represents the password used to connect to the MySql server. */
00044     final static public String PASSWORD    = "-password";
00045 
00046     /** Command line option that represents the name of the database. */
00047     final static public String DBNAME      = "-dbname";
00048 
00049     /** Command line option that represents the name of the soft foreign key detector to use. */
00050     final static public String FKMATCHER   = "-fkmatcher";
00051 
00052     /** Command line option that represents the port's number used by the MySql server. */
00053     final static public String PORT        = "-port";
00054 
00055     /** Args4J option's container for the name of the host that run the MySql server. */
00056     @Option(name=CliOptions.HOST, handler=SpecialStringOptionHandler.class)
00057     private String  __dbhost      = null;
00058 
00059     /** Args4J option's container for the name of the MySql user. */
00060     @Option(name=CliOptions.USER, handler=SpecialStringOptionHandler.class)
00061     private String  __dbuser      = null;
00062 
00063     /** Args4J option's container for the password used to connect to the MySql server. */
00064     @Option(name=CliOptions.PASSWORD, handler=SpecialStringOptionHandler.class)
00065     private String  __dbpassword  = null;
00066 
00067     /** Args4J option's container for the name of the database. */
00068     @Option(name=CliOptions.DBNAME, handler=SpecialStringOptionHandler.class)
00069     private String  __dbname      = null;
00070 
00071     /** Args4J option's container for the soft foreign key detector. */
00072     @Option(name=CliOptions.FKMATCHER, handler=SpecialStringOptionHandler.class)
00073     private String  __db_soft_foreign_key_detector = null;
00074 
00075     /** Args4J option's container for the port's number used by the MySql server.*/
00076     @Option(name=CliOptions.PORT)
00077     private Integer __dbport      = null;
00078 
00079     /** Return the name of the host that run the MySql server.
00080      *  @return Return the name of the host that run the MySql server.
00081      */
00082     public String getHost()      { return this.__dbhost; }
00083 
00084     /**
00085      * Return the name of the name of the MySql's user.
00086      * @return Return the name of the name of the MySql's user.
00087      */
00088     public String getUser()      { return this.__dbuser; }
00089 
00090     /**
00091      * Return the password used to connect to the MySql server.
00092      * @return Return the password used to connect to the MySql server.
00093      */
00094     public String getPassword()  { return this.__dbpassword; }
00095 
00096     /**
00097      * Return the name of the database.
00098      * @return Return the name of the database.
00099      */
00100     public String getDbNanme()   { return this.__dbname; }
00101 
00102     /**
00103      * Return the name of the soft foreign the detector.
00104      * @return Return the name of the soft foreign the detector.
00105      */
00106     public String getSoftForeignKeyDetector() { return this.__db_soft_foreign_key_detector; }
00107 
00108     /**
00109      * Return the port's number used by the MySql server.
00110      * @return Return the port's number used by the MySql server.
00111      */
00112     public Integer getPort()     { return this.__dbport; }
00113 }