2 Replies Latest reply on Feb 20, 2014 4:24 AM by abhijeet.bongarde

    Query related to use of dmr and admin api.

    jamit

      Hi All,

      I am trying to get the Type of VDB (Static/Dynamic)

      I am using jboss dmr to get this information.

      Here is the code snippet for the same:

       

       

      boolean isDynamic = false;
       ModelNode request = new ModelNode();
       request.get(CLIOperations.RECURSIVE).set(true);
       request.get(ClientConstants.OP).set(CLIOperations.LIST_VDBS);
       request.get(ClientConstants.OP_ADDR).add(CLIOperations.SUBSYSTEM, CLIOperations.TEIID);
       ModelNode response;
       try {
        response = new JbossAdmin().execute(request);
        if (response.hasDefined(ClientConstants.RESULT)) {
         List<ModelNode> vdbs = response.get(ClientConstants.RESULT).asList();
         for (ModelNode vdbNode : vdbs) {
          if (vdb.getName().equalsIgnoreCase(vdbNode.get(CLIOperations.VDB_NAME).asString())) {
           isDynamic = vdbNode.get(CLIOperations.XML_VDB_DEPLOYMENT).asBoolean();
           break;
          }
         }
        }
       } catch (IOException e) {
        e.printStackTrace();
       }
      

       

      I wanted to know whether this could be done without using dmr?

      Is there any way out to find out the type of vdb using teiid Admin api?

       

      Thanks

      Amit