dev@glassfish.java.net

Re: Add --force to add-resources

From: Jerome Dochez <Jerome.Dochez_at_Sun.COM>
Date: Wed, 19 Mar 2008 10:53:14 -0700

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 ?

> 'add-resources --force=true foo.xml' would be equiv to something like
> 'update-resources foo.xml'
that would be fine.
>
> vbk
>
> Jerome Dochez wrote:
>> Clearly it won't be --force true by default. We would need to create
>> a new command like dropandcreate-http-listener, which I am not sure
>> would be an improvement typing wise.
>>
>> Jerome
>>
>> On Mar 18, 2008, at 12:50 PM, Vince Kraemer <Vince.Kraemer_at_Sun.COM>
>> wrote:
>>
>>> Kedar Mhaswade wrote:
>>>> Vince Kraemer wrote:
>>>>> Prashanth Abbagani wrote:
>>>>>> [snip]
>>>>>>>
>>>>>>>
>>>>>> Its picking up the file from your current working directory,
>>>>>> which is definitely not the way its been explained in docs. How
>>>>>> can this be fixed, As I own this functionality for V3, I am
>>>>>> interested to see if the behavior can be fixed (Please file a bug
>>>>>> in Sailfin separately)...
>>>>>
>>>>> I already have
>>>>> https://glassfish.dev.java.net/issues/show_bug.cgi?id=4423 filed...
>>>>>
>>>>>>
>>>>>> Now there are two scenarios.
>>>>>> One where asadmin is invoked from a remote machine w.r.t DAS.
>>>>>> Ideally, the file if located on the same machine, should be
>>>>>> uploaded to the DAS machine and continue from there. We can do
>>>>>> this the way deploy command does, with an --upload option,
>>>>>> default is true. So the file is assumed to be on the local
>>>>>> machine by default.
>>>>>> Other, when the file resides on the DAS machine. Which means the
>>>>>> user has to specify --upload=false and should give an absolute
>>>>>> path. This is again inline with how 'deploy' behaves.
>>>>>
>>>>> please add a '--force' option to add-resources, too.
>>>>>
>>>>> It is really painful to have to unregister each resource in a
>>>>> sun-resources.xml file "one by one", if you want to run
>>>>> add-resources a second time... (say you add a new resource to the
>>>>> file or correct a typo, etc...)
>>>>
>>>> Good point. And what should the default value be (probably false)?
>>>
>>> I would prefer true... If it is a useful enhancement, we would want
>>> users to type less... not more.. to be able to use it. If we have
>>> to maintain compatibility with the more limited version of
>>> add-resources, I would advocate creating a new command and
>>> deprecating add-resources.
>>>
>>>>
>>>> How about other create- commands, e.g. create-http-listener,
>>>> create-virtual-server etc.?
>>>
>>> I haven't thought about them yet... I don't use them very often, so
>>> I don't have much user experience to back up my opinion.
>>>
>>>>
>>>> Can you file an RFE for this?
>>>
>>> OK. I created
>>> https://glassfish.dev.java.net/issues/show_bug.cgi?id=438 a while
>>> ago... I update the RFE to include a pointer to your e-mail.
>>>
>>> vbk
>>>
>>>>
>>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: dev-help_at_glassfish.dev.java.net
>