dev@glassfish.java.net

Re: Add --force to add-resources

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Thu, 20 Mar 2008 10:22:54 -0700

On Mar 19, 2008, at 11:20 AM, Vince Kraemer wrote:

> Response in-line below.
>
> vbk
>
> Jerome Dochez wrote:
>> Vince Kraemer wrote:
>>> OK.
>>>
>>> Let's go back to add-resources for minute.
>>>
>>> I think you are saying that the user needs to enter 'add-resources
>>> --force=true foo.xml' to allow them to have a command that
>>> initially registers and/or overwrites existing registrations.
>>> It looks like you are saying that having the new functionality
>>> will cost users about 13 characters.
>>>
>>> Another approach would be to create a new asadmin command that has
>>> the new functionality for less that 26 characters [length of 'add-
>>> resources' plus the length of '--force=true']. The new command
>>> would avoid the introduction of per-usage "cost" (typing extra
>>> characters) , because it would not have to be backward compatible
>>> with a command that is weaker (less functional). An easy choice
>>> might be 'update-resources'....
>>>
>>> So....
>>>
>>> 'add-resources foo.xml' (first call) would be equiv to something
>>> like 'update-resources foo.xml' or 'update-resources --add=true
>>> foo.xml'
>> so if the resource does not exist, and you do update-resources, you
>> would expect it to succeed or fail ? In other words, do you force
>> the user to put --add=true to cover this case ?
>
> I am lazy. I would like to see 'update-resources foo.xml' succeed,
> even when a resource defined in the foo.xml file is not already
> present on the server as the default behavior. In other words, the
> default value for the --add option would be true.
> If the user wanted to force a failure, they could use '--
> add=false'. Part of the reasoning behind my preference is the fact
> that I haven't come up with a use-case where I would want update-
> resources to fail... (Just like I wish there was a method to keep
> add-resources from failing on 'second use'.) I figure there is some
> case where failure is a useful behavior... but I don't see it being
> the 80% side of the 80/20 rule...
I think I can live with this as long as it's not the behaviour of the
create command, because to me, create does not mean update at all. As
we are defining new commands like update, I think we have more freedom
defining their semantics.

we can also add the --force to the create commands, as long as their
default value is false.

jerome

>
>
> vbk
>
>>
>>> 'add-resources --force=true foo.xml' would be equiv to something
>>> like 'update-resources foo.xml'
>> that would be fine.
>>>
>>> vbk
>>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>