Package org.uddi.api_v2

Examples of org.uddi.api_v2.SaveTModel


   * @throws ConfigurationException
   */
  public static void installSaveTModel(EntityManager em, String fileName, UddiEntityPublisher publisher, String nodeId, Configuration config)
    throws JAXBException, DispositionReportFaultMessage, IOException, ConfigurationException {

    SaveTModel apiSaveTModel = (SaveTModel)buildInstallEntity(fileName, "org.uddi.api_v3", config);
    if (apiSaveTModel!=null) installTModels(em, apiSaveTModel.getTModel(), publisher, nodeId);
  }
View Full Code Here


        }
        return false;
    }

    private static void SaveTM(TModel createKeyGenator, String uddi) throws Exception {
        SaveTModel stm = new SaveTModel();
        stm.setAuthInfo(uddi);
        stm.getTModel().add(createKeyGenator);
        publish.saveTModel(stm);
    }
View Full Code Here

                String domain = url.getHost();
                PrintUDDI<TModel> tmodelPrinter = new PrintUDDI<TModel>();
                TModel keygen = UDDIClerk.createKeyGenator("uddi:" + domain + ":keygenerator", domain, "en");

                //save the keygen
                SaveTModel stm = new SaveTModel();
                stm.setAuthInfo(token);
                stm.getTModel().add(keygen);
                System.out.println("Saving the following tModel keygen");
                System.out.println(tmodelPrinter.print(keygen));
                publish.saveTModel(stm);

                properties.put("keyDomain", domain);
                properties.put("businessName", domain);
                properties.put("serverName", url.getHost());
                properties.put("serverPort", url.getPort());
                //wsdlURL = wsdlDefinition.getDocumentBaseURI();
                WADL2UDDI wadl2UDDI = new WADL2UDDI(null, new URLLocalizerDefaultImpl(), properties);

                BusinessService businessServices = wadl2UDDI.createBusinessService(new QName(domain, domain), app);

                Set<TModel> portTypeTModels = wadl2UDDI.createWADLPortTypeTModels(pathOrURL, app);

                // Set<TModel> createWSDLBindingTModels = wadl2UDDI.createWSDLBindingTModels(wsdlURL, allBindings);
                //When parsing a WSDL, there's really two things going on
                //1) convert a bunch of stuff (the portTypes) to tModels
                //2) convert the service definition to a BusinessService
                //Since the service depends on the tModel, we have to save the tModels first
                stm = new SaveTModel();
                stm.setAuthInfo(token);

                TModel[] tmodels = portTypeTModels.toArray(new TModel[0]);
                for (int i = 0; i < tmodels.length; i++) {
                        System.out.println(tmodelPrinter.print(tmodels[i]));
                        stm.getTModel().add(tmodels[i]);
                }

                tmodels = wadl2UDDI.createWADLTModels(pathOrURL, app).toArray(new TModel[0]);
                for (int i = 0; i < tmodels.length; i++) {
                        System.out.println(tmodelPrinter.print(tmodels[i]));
                        stm.getTModel().add(tmodels[i]);
                }
                //important, you'll need to save your new tModels, or else saving the business/service may fail
                System.out.println("Saving the following tModels " + stm.getTModel().size());
                publish.saveTModel(stm);

                //finaly, we're ready to save all of the services defined in the WSDL
                //again, we're creating a new business, if you have one already, look it up using the Inquiry getBusinessDetails
                PrintUDDI<BusinessService> servicePrinter = new PrintUDDI<BusinessService>();
View Full Code Here

        AuthToken authToken = security.getAuthToken(getAuthTokenRoot);
        TModel createKeyGenator = UDDIClerk.createKeyGenator("uddi:testdomain:keygenerator", "a name", "en");

        TModel createKeyGenator2 = UDDIClerk.createKeyGenator("uddi:testdomain2:keygenerator", "a name", "en");

        SaveTModel st = new SaveTModel();
        st.setAuthInfo(authToken.getAuthInfo());
        st.getTModel().add(createKeyGenator);
        st.getTModel().add(createKeyGenator2);
        publish.saveTModel(st);

        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authToken.getAuthInfo());
        BusinessEntity be = new BusinessEntity();
View Full Code Here

                        //for jUDDI, the following is required
                        //  Name
                        //  CategoryBag/KR for the below fixed values
                        //  a tModelKey that starts with uddi:<something>:keygenerator - all lower case
                        //First, Here's the long way to do it to make a Key Generator tModel.
                        SaveTModel st = new SaveTModel();
                        st.setAuthInfo(key);
                        TModel tm = new TModel();
                        tm.setName(new Name());
                        tm.getName().setValue("My Company's Keymodel generator");
                        tm.getName().setLang("en");
                        tm.setCategoryBag(new CategoryBag());
                        KeyedReference kr = new KeyedReference();
                        kr.setTModelKey("uddi:uddi.org:categorization:types");
                        kr.setKeyName("uddi-org:keyGenerator");
                        kr.setKeyValue("keyGenerator");
                        tm.getCategoryBag().getKeyedReference().add(kr);
                        tm.setTModelKey("uddi:www.mycoolcompany.com:keygenerator");
                        st.getTModel().add(tm);
                        TModelDetail saveTModel = publish.saveTModel(st);
                        System.out.println("Creation of Partition Success!");

                        //Here's the easy and fun way!
                        TModel keygen = UDDIClerk.createKeyGenator("www.mycoolcompany.com", "My Company's Keymodel generator", "en");
                        //st = new SaveTModel();
                        //st.setAuthInfo(key);
                        //st.getTModel().add(keygen);
                        //saveTModel = publish.saveTModel(st);
                       

                        //Now lets make a few tModels using the new domain
                        tm = new TModel();
                        tm.setName(new Name());
                        tm.getName().setValue("My Company's Department");
                        tm.getName().setLang("en");
                        tm.setTModelKey("uddi:www.mycoolcompany.com:department");
                        st.getTModel().add(tm);
                        saveTModel = publish.saveTModel(st);
                        System.out.println("Creation of tModel Department Success!");

                        tm = new TModel();
                        tm.setName(new Name());
                        tm.getName().setValue("My Company's Authentication Method");
                        tm.getName().setLang("en");
                        tm.setTModelKey("uddi:www.mycoolcompany.com:authmode");
                        st.getTModel().add(tm);
                        saveTModel = publish.saveTModel(st);
                        System.out.println("Creation of tModel Auth Mode Success!");

                } catch (Exception e) {
                        e.printStackTrace();
View Full Code Here

                        }
                }

                TModel keygen = UDDIClerk.createKeyGenator("uddi:" + domain + ":keygenerator", domain, "en");
                //save the keygen
                SaveTModel stm = new SaveTModel();
                stm.setAuthInfo(token);
                stm.getTModel().add(keygen);
                System.out.println("Saving key gen " + keygen.getTModelKey());
                publish.saveTModel(stm);
                System.out.println("Saved!");

                //step three, we have two options
                //1) import the wsdl's services into a brand new business
                //2) import the wsdl's services into an existing business
                //in either case, we're going to have to parse the WSDL
                ReadWSDL rw = new ReadWSDL();
                Definition wsdlDefinition = null;
                if (pathOrURL.startsWith("http")) {
                        wsdlDefinition = rw.readWSDL(new URL(pathOrURL));
                } else {
                        wsdlDefinition = rw.readWSDL(pathOrURL);
                }

                if (wsdlDefinition == null) {
                        System.out.println("There was an error parsing the WSDL!");
                        return;
                }
                properties.put("keyDomain", domain);
                properties.put("businessName", domain);
                properties.put("serverName", domain);
                properties.put("serverPort", port);
                wsdlURL = wsdlDefinition.getDocumentBaseURI();
                WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(null, new URLLocalizerDefaultImpl(), properties);
                BusinessServices businessServices = wsdl2UDDI.createBusinessServices(wsdlDefinition);
                @SuppressWarnings("unchecked")
                Map<QName, PortType> portTypes = (Map<QName, PortType>) wsdlDefinition.getAllPortTypes();
                Set<TModel> portTypeTModels = wsdl2UDDI.createWSDLPortTypeTModels(wsdlURL, portTypes);
                Map allBindings = wsdlDefinition.getAllBindings();
                Set<TModel> createWSDLBindingTModels = wsdl2UDDI.createWSDLBindingTModels(wsdlURL, allBindings);
        //When parsing a WSDL, there's really two things going on
                //1) convert a bunch of stuff (the portTypes) to tModels
                //2) convert the service definition to a BusinessService

                //Since the service depends on the tModel, we have to save the tModels first
                stm = new SaveTModel();
                stm.setAuthInfo(token);

                TModel[] tmodels = portTypeTModels.toArray(new TModel[0]);
                for (int i = 0; i < tmodels.length; i++) {
                        stm.getTModel().add(tmodels[i]);
                }

                tmodels = createWSDLBindingTModels.toArray(new TModel[0]);
                for (int i = 0; i < tmodels.length; i++) {
                        stm.getTModel().add(tmodels[i]);
                }

                //important, you'll need to save your new tModels first, or else saving the business/service may fail
                System.out.println(new PrintUDDI<SaveTModel>().print(stm));
                System.out.println("Saving " + stm.getTModel().size() + " tModels");
                publish.saveTModel(stm);
                System.out.println("Saved!");

                if (businessKey == null || businessKey.length() == 0) {
                        SaveBusiness sb = new SaveBusiness();
View Full Code Here

                sb.getBusinessEntity().add(be);
                publish.saveBusiness(sb);
        }

        private static void SaveTM(TModel createKeyGenator, String uddi) throws Exception {
                SaveTModel stm = new SaveTModel();
                stm.setAuthInfo(uddi);
                stm.getTModel().add(createKeyGenator);
                publish.saveTModel(stm);
        }
View Full Code Here

   * @throws ConfigurationException
   */
  public static void installSaveTModel(EntityManager em, String fileName, UddiEntityPublisher publisher, String nodeId, Configuration config)
    throws JAXBException, DispositionReportFaultMessage, IOException, ConfigurationException {

    SaveTModel apiSaveTModel = (SaveTModel)buildInstallEntity(fileName, "org.uddi.api_v3", config);
    installTModels(em, apiSaveTModel.getTModel(), publisher, nodeId);
  }
View Full Code Here

   * @throws ConfigurationException
   */
  public static void installSaveTModel(EntityManager em, String fileName, UddiEntityPublisher publisher, String nodeId, Configuration config)
    throws JAXBException, DispositionReportFaultMessage, IOException, ConfigurationException {

    SaveTModel apiSaveTModel = (SaveTModel)buildInstallEntity(fileName, "org.uddi.api_v3", config);
    if (apiSaveTModel!=null) installTModels(em, apiSaveTModel.getTModel(), publisher, nodeId);
  }
View Full Code Here

   * @throws ConfigurationException
   */
  public static void installSaveTModel(EntityManager em, String fileName, UddiEntityPublisher publisher, String nodeId, Configuration config)
    throws JAXBException, DispositionReportFaultMessage, IOException, ConfigurationException {

    SaveTModel apiSaveTModel = (SaveTModel)buildInstallEntity(fileName, "org.uddi.api_v3", config);
    if (apiSaveTModel!=null) installTModels(em, apiSaveTModel.getTModel(), publisher, nodeId);
  }
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.SaveTModel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.