// file: $ISIP_IFC/util/demo/isip_comm_client_dialog_navigation/DialogNavigationArgParser.java
// version: $Id: DialogNavigationArgParser.java 10054 2005-05-06 21:37:54Z elliott $ 
//

// import necessary java libraries
//

// import galaxy libraries
// 
import galaxy.util.ArgParser;

/**
 * The argument parser processes an array of arguments (key/values
 * pairs). This class gets the port numbers and ip addresses.
 */
public class DialogNavigationArgParser extends DemoArgParser {

    //-------------------------------------------------------------------------
    //
    // public constants
    //
    //-------------------------------------------------------------------------

    // Default parameters
    //

    /**
     * Default args for MySQL hostname
     */
    public static final String DEFAULT_MYSQL_HOSTNAME_ARG = "127.0.0.1";

    /**
     * Default args for MySQL username
     */
    public static final String DEFAULT_MYSQL_USERNAME_ARG = "dialog";

    /**
     * Default args for MySQL password
     */
    public static final String DEFAULT_MYSQL_PASSWORD_ARG = "pass123";

    /**
     * Default args for MySQL database
     */
    public static final String DEFAULT_MYSQL_DATABASE_ARG = "flatroute";

    // Argument names
    //

    /**
     * Default args for MySQL hostname
     */
    public static final String MYSQL_HOSTNAME_ARG = "-mysql_hostname";

    /**
     * Default args for MySQL username
     */
    public static final String MYSQL_USERNAME_ARG = "-mysql_username";

    /**
     * Default args for MySQL password
     */
    public static final String MYSQL_PASSWORD_ARG = "-mysql_password";

    /**
     * Default args for MySQL database
     */
    public static final String MYSQL_DATABASE_ARG = "-mysql_database";

    //------------------------------------------------------------------------
    //
    // protected data
    //
    //-----------------------------------------------------------------------

    
    //-------------------------------------------------------------------------
    //
    // public methods
    //
    //-------------------------------------------------------------------------

    /**
     * Constructor, call the super class's constructor
     *
     * @param args_a arguments from the command line.
     */
    public DialogNavigationArgParser (String args_a[]) {
	super(args_a);
    }
    
    //-------------------------------------------------------------------------
    //
    // class-specific public methods:
    //  set methods
    //
    //-------------------------------------------------------------------------


    //-------------------------------------------------------------------------
    //
    // class-specific public methods:
    //  get methods
    //
    //-------------------------------------------------------------------------

    /**
     * Return an integer value according to the parameter
     *
     * @return the value of the argument or the default value if it
     * has no value.
     */

    /**
     * Return the string value of the specified argument.
     *
     * @return the value of the argument or the default value if it
     * has no value or the argument does not exist
     */
    public String getMode() {

	// return the string value of the specified argument
	//
	return getStringArg(WORKING_MODE_ARG,
			    DEFAULT_WORKING_MODE);
			    }

    /**
     * Return the string value of the specified argument.
     *
     * @return the value of the argument or the default value if it
     * has no value or the argument does not exist
     */
    public String getMysqlHostname() {

	// return the string value of the specified argument
	//
	return getStringArg(MYSQL_HOSTNAME_ARG,
			    DEFAULT_MYSQL_HOSTNAME_ARG);
    }

    /**
     * Return the string value of the specified argument.
     *
     * @return the value of the argument or the default value if it
     * has no value or the argument does not exist
     */
    public String getMysqlUsername() {

	// return the string value of the specified argument
	//
	return getStringArg(MYSQL_USERNAME_ARG,
			    DEFAULT_MYSQL_USERNAME_ARG);
    }

    /**
     * Return the string value of the specified argument.
     *
     * @return the value of the argument or the default value if it
     * has no value or the argument does not exist
     */
    public String getMysqlPassword() {

	// return the string value of the specified argument
	//
	return getStringArg(MYSQL_PASSWORD_ARG,
			    DEFAULT_MYSQL_PASSWORD_ARG);
    }


    /**
     * Return the string value of the specified argument.
     *
     * @return the value of the argument or the default value if it
     * has no value or the argument does not exist
     */
    public String getMysqlDatabase() {

	// return the string value of the specified argument
	//
	return getStringArg(MYSQL_DATABASE_ARG,
			    DEFAULT_MYSQL_DATABASE_ARG);
    }

} // end of DialogNavigationArgParser
