admin@glassfish.java.net

how to implement these cli commands?

From: Carla Mott <carla.mott_at_oracle.com>
Date: Thu, 10 Jun 2010 20:47:07 -0700

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