admin@glassfish.java.net

Re: how to implement these cli commands?

From: Carla Mott <carla.mott_at_oracle.com>
Date: Fri, 11 Jun 2010 10:55:15 -0700

I'm thinking I will refactor the code so that the existing command
create-node-ssh becomes _create-node which is a CRUD command and create
2 remote commands create-node-ssh and create-node-config which call
_create-node with the right values.

It is new code but has to support some old behavior
(create-nodeagent-config which doesn't exist in v3).

carla

Jerome Dochez wrote:
> let me just start by saying that it is really weird to have 2 commands
> adding the same configuration objects but with different sub objects.
> Is this inherited from v2 or it's new ?
>
> now if we were to allow to multiple @Create annotations on a single
> method declaration, only the Decorator implementation could vary
> between the 2 commands as the @Param annotation (placed at the Node
> level if your example below) would make the 2 commands have the same
> parameter list (well almost since the Decorator can have @Param too
> and can be different between the 2 commands). Is this what you need ?
>
> jerome
>
> On 6/10/10 8:47 PM, Carla Mott wrote:
>>
>> Hi,
>>
>> I have 2 commands that I need to implement and one is a subset of the
>> other, example below. How can I do this using CRUD? What is the
>> best way to implement?
>>
>> I tried having two @Create statements but that doesn't work...
>>
>> create-node-ssh is a CRUD command implemented using 2 classes, Nodes
>> and Node. It creates the following xml depending on whether the ssh
>> related options are specified or not.
>>
>> <nodes>
>> <node name="node1" nodehost="host1" />
>> <node name="node2" nodehost="host2" >
>> <ssh-connection port="22" sshnode="host3" />
>> </node>
>> </nodes>
>>
>>
>> create-node-config will create a node element that is just like the
>> first node element above. it never has the ssh connector
>> subelement. So it will always look like:
>> <nodes>
>> <node name="node1" nodehost="host1" />
>> </nodes>
>>
>> There is only one <nodes> element and either of the commands can add
>> their respective 'node' sub-element entires. Since
>> create-node-config is creating what is a complete subset of
>> create-node-ssh how to best implement this?
>>
>> Thanks,
>> Carla
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
>> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: admin-unsubscribe_at_glassfish.dev.java.net
> For additional commands, e-mail: admin-help_at_glassfish.dev.java.net
>