2 Replies Latest reply on Sep 5, 2011 2:14 PM by frankie007

    How to execute an operation of a child resource (using dmr library)?

    frankie007

      Hi,

       

      I'm writing a management client using the dmr library.

       

      I need to be able to execute an operation of a child of a resource.

      For example: I want to read the operation description of the "add" operation of the jms-topic resource.

      How should I build the address?

      I understand that the address exists of key-value pairs, but what is the key of a child resource?

       

      My code looks like this:

       

      ModelControllerClient client = ModelControllerClient.Factory.create(InetAddress.getByName("localhost",9999);

      ModelNode operation = new ModelNode();

      operation.get("operation").set("read-operation-description"); //set the operation name

      operation.get("name").set("add"); // set the input parameter(s)

      ModelNode address = operation .get("address");

      address.add("subsystem", "messaging");

      // next part of the address:  I've tried a lot of combinations, but nothing worked.

      // something like address.add("?", "jms-topic");

      ModelNode returnVal = client.execute(operation);

       

       

      Could you please help me with this one?

      I've searched through all the documentation, but I can't find a solution.

       

      Thanks a lot,

       

      Laurenz