7 Replies Latest reply on Mar 20, 2013 2:54 PM by rareddy

    Programmatically Creating VDB

    pinkstondevin

      Hello,

       

      I am currently working through creating a dynamic VDB programmatically and was wondering if this is the most direct solution:

           - Use VDBMetadata to set properties

           - Marshall using JAXB

           - Deploy using admin.deployVDB

       

      Just wondering if this is the most direct solution using 8.3.

       

      Thanks

        • 1. Re: Programmatically Creating VDB
          rareddy

          Devin,

           

          Yes, as of 8.3. See TestVDBMetaData for mashelling/unmarshell as JAXB annotations are not present on the VDBMetadata. Also note VDBMetadata is not part public API can change in future releases without notification.

           

          Ramesh..

          1 of 1 people found this helpful
          • 2. Re: Programmatically Creating VDB
            pinkstondevin

            Ramesh,

             

            If i plan to deploy the vdb using the admin console, do i need to create an admin programmatically as well?  Can i create and set the metadata of a VDB without the creation of an admin?

             

            Thanks.

            • 3. Re: Programmatically Creating VDB
              rareddy

              Devin,

               

              You can programatically deploy the VDB too, so that you can automate the whole process. Teiid supports creating a "admin" connection, once the connection is created then you have access to variety of calls available on this interface.  You can get "admin" connection using AdminFactory.  You can some test examples here.

               

              HTH

               

              Ramesh..

              1 of 1 people found this helpful
              • 4. Re: Programmatically Creating VDB
                pinkstondevin

                Ramesh,

                 

                Thanks!  I didn't see those tests, they are very helpful, I appreciate it.

                 

                I've been reading through them for about 30 minutes, good stuff in here.  Are there any tests defining a VDB and its metadata? 

                 

                The admin tests are great.

                 

                Thanks

                • 5. Re: Programmatically Creating VDB
                  rareddy

                  Devin,

                   

                  You seen the test to create the -vdb.xml already. The only remaining question is how you can define the metadata for your VDB and sources. This should give you a better example on how to define metadata for your view model in VDB https://docs.jboss.org/author/display/TEIID/DDL+Metadata

                   

                  My suggestion is go through a quick example, as to how Teiid works. Then go about building the VDB programmatically.

                   

                  Ramesh..

                  • 6. Re: Programmatically Creating VDB
                    pinkstondevin

                    Thank you Ramesh.

                     

                    I went through the documentation online and worked through the quickstart as well.

                     

                    I decided it would be a good first test to try and programmatically do the federation quick start ,using the same datasources.  However when I try to create a new admin in my standalone application, i keep receiving this:

                     

                    Mar 20, 2013 1:13:22 PM org.xnio.Xnio <clinit>

                    INFO: XNIO Version 3.0.7.GA

                    Mar 20, 2013 1:13:22 PM org.teiid.adminapi.AdminFactory createAdmin

                    INFO: TEIID70051 The controller is not available at localhost:9,999

                     

                    There was another person on here who had the same problem, but their work didnt seem to help.

                     

                    Any insight?

                     

                    Thanks

                    • 7. Re: Programmatically Creating VDB
                      rareddy

                      It depends on how you started your server. Or it can be that your Admin application and server are not on the same machine. Provide the correct host, port  to the Admin connection then it will work.