admin@glassfish.java.net

Re: how to implement these cli commands?

From: Jerome Dochez <jerome.dochez_at_oracle.com>
Date: Fri, 11 Jun 2010 09:47:42 -0700

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
>