admin@glassfish.java.net

stop-domain

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Wed, 26 Aug 2009 21:13:25 -0700

I'm thinking about how stop-domain should work and looking at this bug:
https://glassfish.dev.java.net/issues/show_bug.cgi?id=9229

Unlike v2, stop-domain is supposed to work both locally and remotely,
and I'm trying to figure out how this should work while also fixing
the bug above. I'd appreciate any feedback on my thinking...

Things to consider:

Was a host specified (with --host or AS_ADMIN_HOST)?
Was a domain name operand specified?
How many local domains are there?

Based on the above, do we do a local operation, remote operation,
or is it an error?

Here's the table of cases and results:

--host N N N N N N Y Y Y Y Y Y
domain operand N N N Y Y Y N N N Y Y Y
domains 0 1 >1 0 1 >1 0 1 >1 0 1 >1
local/rem/err E L E E L L R R R E E E

Does that look right? Am I missing any important cases?

Should explicitly specifying "--host localhost" be the same as or different
than not specifying a host name and allowing it to default?

Should specifying --port in the local case be an error or just ignored?

For the local case...

- there *must* be a local password
- the local password is always used
- the host is always localhost and the port comes from domain.xml
- authentication must succeed
- the local password is passed as an operand to the stop-domain remote command
- the server stop-domain command checks that the operand is the local password

For the remote case...

- local domain information is ignored
- the host name and port number are used
- the user name and password are specified or defaulted
- authentication must succeed
- the stop-domain remote command gets no operand
- with no operand, the stop-domain server command always stops


Should restart-domain use the same approach?