Changes needed for HADB Management 2.0
Additions needed

X parse properties sent to create-db for the tons (32) of possible args
SATHYAN: change a template file somewhere that has the dirname wired in -- SUNWhadb --> hadb
X change --hosts from required to optional and use 'localhost' as the default

old args:
	gone	args[1]		= "--installpath="				+ HADB_ROOT;
	gone	args[2]		= "--configpath="				+ HADB_CONFIG_ROOT;
	both	args[3]		= "--historypath="				+ tmpdir;
	both	args[4]		= "--devicepath="				+ HADB_ROOT;
	both	args[5]		= "--datadevices="				+ "1";
	both	args[6]		= "--portbase="					+ "15200";
	both	args[7]		= "--spares="					+ "0";
	gone	args[8]		= "--set=managementProtocol="	+ protocol;
	gone	args[9]		= "--inetd="					+ "false";
	gone	args[10]	= "--inetdsetupdir="			+ tmpdir;
	both	args[11]	= "--devicesize="				+ deviceSize;
	both	args[12]	= "--dbpassword="				+ getSystemPassword();
	both	args[13]	= "--hosts="					+ hosts;
		

new args:
both [--historypath=path]
both [--devicepath=path]
both [--datadevices=number of devices per node]
both [--portbase=base no]
both [--spares=number of spares]
new  [--set=attr-name-value-list]
new  [--agent=maurl]
new  [--no-cleanup]
new  [--no-clear]
both --devicesize=size
both --dbpassword=password
new  --dbpasswordfile=file
both --hosts=host list

=====================================================================

1). For hadbm create command
a). A new argument by name --agent=<URL> needs to be passed.
This URL value will be <each host list in --hosts argument>:<accepted 
agentPort>
Ex.
./asadmin configure-ha-cluster --hosts machine1,machine2 --agentport 
3894 will translate
to
    --agent=machine1:3984,machine2:3984

b). --devicepath should default to <InstallDir>/hadb/4/devices. 
Installer will automatically
create this directory.

c). --historypath should default to <InstallDir>/hadb/4/history. 
Installer will automatically
create this directory.

d). --hosts can also default to localhost,localhost if one is not 
passed. We can
make this as an optional argument.

Usage: hadbm create
                    [--historypath=path]
                    [--devicepath=path]
                    [--datadevices=number of devices per node]
                    [--portbase=base no]
                    [--spares=number of spares]
                    [--set=attr-name-value-list]
                    [--agent=maurl]
                    [--no-cleanup]
                    [--no-clear]
                    --devicesize=size
                    --dbpassword=password | --dbpasswordfile=file
                    --hosts=host list
                    [dbname]
Creates a database
        -P, --dbpasswordfile=file  the file from which the passwords are 
read
        -z, --devicesize=size   Size of the device in MB
        -p, --dbpassword=password  the database system user password
        -H, --hosts=hostlist    Comma or double quote enclosed space 
separated l
ist of all hosts used for all nodes
        -t, --historypath=path  Path for the history files
        -d, --devicepath=path   Path for data and log devices
        -a, --datadevices=number   Number of data devices on each node
        -b, --portbase=port     Port base number used for node 0. Other 
nodes ar
e assigned port number bases in steps of 20 from the number specified here
        -s, --spares=number     Number of hosts to be used as spares
        -S, --set=list          Comma or double quote enclosed space 
separated l
ist of attributes name=value pairs that will be set at the time of 
creation of d
atabase
        -m, --agent=maurl       URL to management agent (host:port)
        --no-cleanup            Do not delete database historyfiles, 
devices and
 configfiles if create fails
        --no-clear              Do not start the database processes 
during creat
e. The database will be in state stopped after create if this option is 
given.
        -q, --quiet             Does not print headers
        -?, --help              Displays the help information for a command
        -V, --version           for printing the version details of hadbm
        -y, --yes               command is executed non-interactively 
taking "Ye
s" answer to all prompts
        -f, --force             Does not prompt for confirmation and 
error is no
t thrown in case state is already achieved
        -e, --echo              Displays the full command on the console 
before
execution



2). For hadbm status command
a). A new argument by name --agent=<URL> needs to be passed. The value is
explained above.

This is the syntax
Usage: hadbm status [--nodes] [dbname]
Displays the status of database or nodes
        -n,--nodes              Displays status of nodes
        -m, --agent=maurl       URL to management agent (host:port)
        -q, --quiet             Does not print headers
        -?, --help              Displays the help information for a command
        -V, --version           for printing the version details of hadbm
        -y, --yes               command is executed non-interactively 
taking "Ye
s" answer to all prompts
        -f, --force             Does not prompt for confirmation and 
error is no
t thrown in case state is already achieved
        -e, --echo              Displays the full command on the console 
before
execution

3).For hadbm stop command
a). A new argument by name --agent=<URL> needs to be passed. The value is
explained above.

This is the complete syntax
Usage: hadbm stop [--force] [dbname]
Stops a database
        -f, --force             Does not prompt for confirmation and 
error is no
t thrown in case state is already achieved
        -m, --agent=maurl       URL to management agent (host:port)
        -q, --quiet             Does not print headers
        -?, --help              Displays the help information for a command
        -V, --version           for printing the version details of hadbm
        -y, --yes               command is executed non-interactively 
taking "Ye
s" answer to all prompts
        -e, --echo              Displays the full command on the console 
before
execution


4).For hadbm stop command
a). A new argument by name --agent=<URL> needs to be passed. The value is
explained above.

This is the complete syntax
Usage: hadbm delete [dbname]
Deletes a database
        -m, --agent=maurl       URL to management agent (host:port)
        -q, --quiet             Does not print headers
        -?, --help              Displays the help information for a command
        -V, --version           for printing the version details of hadbm
        -y, --yes               command is executed non-interactively 
taking "Ye
s" answer to all prompts
        -f, --force             Does not prompt for confirmation and 
error is no
t thrown in case state is already achieved
        -e, --echo              Displays the full command on the console 
before
execution


5). ./hadbm get jdbcURL
A new argument by name --agent=<URL> needs to be passed. The value is 
explained
above.
This is the complete syntax.
Usage: hadbm get [--all | attribute-name-list ] [dbname]
Displays database parameter
        -a,--all                Displays all the database parameters
        -m, --agent=maurl       URL to management agent (host:port)
        -q, --quiet             Does not print headers
        -?, --help              Displays the help information for a command
        -V, --version           for printing the version details of hadbm
        -y, --yes               command is executed non-interactively 
taking "Ye
s" answer to all prompts
        -f, --force             Does not prompt for confirmation and 
error is no
t thrown in case state is already achieved
        -e, --echo              Displays the full command on the console 
before
execution



This means that all of the ha related commands should take an optional 
hosts list and
a required --maagentport.
HADB default for agent port is 1862.
HADB default for agent URL is localhost:1862.



**************************************************************************************************
**************************************************************************************************
**********   Email from Ken    *******************************************************************
**************************************************************************************************
**************************************************************************************************


Byron, Sathyan, & I met yesterday to discuss the remaining work to be done wrt to HADB mgmt. Here is a summary...

   1.We need to define the semantics of configure-ha-cluster and remove-ha-cluster when the cluster's configuration is shared (i.e. with another cluster or
     unclustered instance). There are two approaches: 
        1.Do not allow create-ha-store on a cluster with a shared configuration. 
        2.Modify the shared configuration to reference only one of the hadb resources. We had chosen this approach, because it is more flexible; however,
          after thinking about this some more, I think option 1 is better. If we stick with option 2, then out of the box both clusters will share the same
          HADB (which we do not want), and informing customers how to introduce system-property tokens is painful and error prone. 
   2.We need to define the semantics of deleting a cluster which was configured for HA using configure-ha-cluster. There are a couple of options: 
        1.Do not allow an HA cluster to be deleted unless its corresponding ha store has been deleted. 
        2.Allow the HA cluster to be deleted. Users must be able to remove-ha-cluster on a cluster which has been deleted to later clean up the database.
          Unless issues arise, this is the approach we decided to adopt.
   3.We have determined that we need to keep the clear-ha-store command. We need to ensure that our create-ha-store and clear-ha-store have roughly
     the same functionality as their Hercules counterparts (create-session-store and clear-session-store). In looking at the table below, I see that we are
     missing some the storeuser, storepassword, and dbsystempassword options. 
   4.Introduction of the new HADB bits (coming on Friday) will require configuration of an HADB management port. This will not be stored in domain.xml
     and as such will be a new optional (since there is a well known default value) management port option to all of the HADB commands (create-ha-store,
     clear-ha-store, configure-ha-cluster, remove-ha-cluster). 
   5.We have decided that the DAS will not run an HADB management agent as previously thought. 
   6.When invoking hadbm, we need to ensure that we are not passing passwords on the command line. Instead, we should be creating a protected,
     temporary password file and using the passwordfile option to hadbm. 
   7.After looking at the Glaucus admin guide, I have reached the conclusion that we should introduce a configure-ha-persistence command (see table
     below).
   8.What happens when configure-ha-cluster is given an operand which is not a clusterName (e.g. a config name or server name)?  
   9.Finally, we need to make sure that the semantics of all these commands are well documented somewhere e.g. a functional spec. This will assist in
     testing, documentation, etc.


 7.1 EE CLI Command
                                                            8.1 CLI Command 
 asadmin create-session-store [--storeurl persistent-store-url] [--storeuser
 username [--storepassword userpassword] [--dbsystempassword
 systempassword]] | [--optionsfile file-name]
                                                            asadmin create-ha-store [--host localhost] [--port 4848] [--user user]
                                                            [--password password] databaseName

                                                            Needs: storeuser, storepassword, dbsystempassword and the ability to
                                                            propagate these passwords via the password file or interactively through
                                                            prompting. Not sure whether the optionsfile is necessary.
 asadmin clear-session-store [--storeurl persistent-store-url] [--storeuser
 username] [--storepassword userpassword] [--optionsfile file_name]
                                                            asadmin clear-ha-store [--host localhost] [--port 4848] [--user user]
                                                            [--password password] databaseName

                                                            Needs: storeuser, storepassword, dbsystempassword and the ability to
                                                            propagate these passwords via the password file or interactively through
                                                            prompting. Not sure whether the optionsfile is necessary.
 asadmin configure-session-persistence  [--type
 persistence-type] [--frequency frequency] [--scope scope] [--store
 jdbc-resource-jndi-name] [--property name=value[:name=value]*]
 instance_name
                                                            N/A. Proposed:

                                                            asadmin configure-ha-persistence [--type
                                                            persistence-type] [--frequency frequency] [--scope scope] [--store
                                                            jdbc-resource-jndi-name] [--property name=value[:name=value]*]
                                                            clusterName
 clsetup (SCRIPT)
                                                            asadmin configure-ha-cluster [--host localhost] [--port 4848] [--user user]
                                                            [--password password] [--devicesize devicesize] --hosts hadb-host-list
                                                            [--property (name=value)[:name=value]*] clusterName
 N/A
                                                            asadmin remove-ha-cluster [--host localhost] [--port 4848] [--user user]



