users@glassfish.java.net

Re: why are there multiple redundant start-X subcommands for asadmin?

From: Tom Mueller <tom.mueller_at_oracle.com>
Date: Thu, 19 May 2011 12:00:40 -0700

Generally within the asadmin CLI, we have many cases where there is a
choice between doing:

verb-type1
verb-type2

or

verb --type type1
verb --type type2

Consider, for example, that we have many create commands. Why don't we
have:

create --type cluster
create --type jdbc-resource
?

Generally, the answer to this is determined by the variation in the set
of options that are passed to the commands. If the options are
basically the same, but there is just some subtle variation in the type,
then commands use a --type option. For example see, create-ssl.
However, if there is a large difference in the options, or the objects
are conceptually different, then different commands are used.

So, we have create-domain, create-instance, create-local-instance, etc.
because the options and concepts are vary substantially.

Regarding start specifically, there are separate start commands to match
the corresponding create, delete, and list commands. Also, the options
that can be passed to these commands are actually quite different.
Finally, some of these are local commands (start-domain,
start-local-instance) while others are remote (start-cluster,
start-instance).

BTW, you can have a cluster or an instance named with the same name as
the domain. So "start domain1" could mean to start the domain or a
cluster/instance.

Tom


On 5/19/2011 10:53 AM, Vince Kraemer wrote:
> it looks like we have a bunch of different commands that start a named
> thing.
>
> start-domain D
> start-cluster C
> start-instance I
> start-local-instance LI
>
> There is also a constraint in the domain that prevents reused names...
> so you cannot have a cluster named c1 and an instance named c1 in
> domain.xml...
>
> So, it seems like there could be a single 'start' command that could
> replace start-cluster, start-instance, start-local-instance...
>
> Since there isn't a 'start' command, I must be missing something.
>
> What is it?
>
> Thanks,
> vbk
>
>