Package org.uddi.api_v2

Examples of org.uddi.api_v2.TModel


        public void CreateTmodelnoKeyGen() throws DispositionReportFaultMessage, RemoteException {
                System.out.println("CreateTmodelnoKeyGen");

                SaveTModel st = new SaveTModel();
                st.setAuthInfo(authInfoJoe);
                TModel tm = new TModel();
                tm.setName(new Name());
                tm.getName().setValue("CreateTmodelnoKeyGen My Cool Company's tmodel");
                tm.getName().setLang("en");

                tm.setTModelKey("uddi:uddi.joepublisher.com:nokeygenerator:customkey");
                st.getTModel().add(tm);
                try {
                        @SuppressWarnings("unused")
                        TModelDetail saveTModel = publicationJoe.saveTModel(st);
                        Assert.fail("request should have been rejected");
View Full Code Here


        this.lang = properties.getProperty(Property.LANG, Property.DEFAULT_LANG);
    }

    public Set<TModel> createWADLTModels(String wadlURL, Application app) throws Exception {
        Set<TModel> tModels = new HashSet<TModel>();
        TModel binding = new TModel();
        binding.setTModelKey(keyDomainURI + "binding");
       
        Name sName = new Name();
        sName.setLang(lang);
        if (!app.getDoc().isEmpty()) {
            sName.setValue(app.getDoc().get(0).getTitle());
        }
        if (sName.getValue() == null) {
            sName.setValue(keyDomainURI + " Binding tModel");
        }
        binding.setName(sName);
        tModels.add(binding);
       
       
         binding = new TModel();
        binding.setTModelKey(keyDomainURI + "rest");
       
        sName = new Name();
        sName.setLang(lang);
        if (!app.getDoc().isEmpty()) {
            sName.setValue(app.getDoc().get(0).getTitle());
        }
        if (sName.getValue() == null) {
            sName.setValue(keyDomainURI + " Rest tModel");
        }
        binding.setName(sName);
        tModels.add(binding);
       

        //keyDomainURI + "binding"
        return tModels;
View Full Code Here

         */
        @Test
        public void testGetTModelDetailXML() {
                System.out.println("testGetTModelDetailXML");

                TModel result = instance.getTModelDetailXML(JUDDI_TMODEL);
                Assert.assertNotNull(result);
                Assert.assertNotNull(result.getName());
                Assert.assertNotNull(result.getTModelKey());

        }
View Full Code Here

        @Test(expected = WebApplicationException.class)
        public void testGetTModelDetailJSON_NULL() {
                System.out.println("getTModelDetailJSON_NULL");
                String id = UUID.randomUUID().toString();

                TModel expResult = null;
                TModel result = instance.getTModelDetailJSON(id);

        }
View Full Code Here

        @Test
        public void testGetTModelDetailJSON() {
                System.out.println("testGetTModelDetailJSON");

                TModel result = instance.getTModelDetailJSON(JUDDI_TMODEL);
                Assert.assertNotNull(result);
                Assert.assertNotNull(result.getName());
                Assert.assertNotNull(result.getTModelKey());

        }
View Full Code Here

        new FatalErrorException(new ErrorMessage("errors.install.AlreadyInstalled"));
     
     
      String rootPublisherStr = config.getString(Property.JUDDI_ROOT_PUBLISHER);
      String fileRootTModelKeygen = rootPublisherStr + FILE_TMODELKEYGEN;
      TModel rootTModelKeyGen = (TModel)buildInstallEntity(fileRootTModelKeygen, "org.uddi.api_v3", config);
      String fileRootBusinessEntity = rootPublisherStr + FILE_BUSINESSENTITY;
      org.uddi.api_v3.BusinessEntity rootBusinessEntity = (org.uddi.api_v3.BusinessEntity)buildInstallEntity(fileRootBusinessEntity, "org.uddi.api_v3",config);
     
      String rootPartition = getRootPartition(rootTModelKeyGen);
      String nodeId = getNodeId(rootBusinessEntity.getBusinessKey(), rootPartition);
     
      String fileRootPublisher = rootPublisherStr + FILE_PUBLISHER;
      if (!alreadyInstalled) {
        log.info("Loading the root Publisher from file " + fileRootPublisher);
     
        rootPublisher = installPublisher(em, fileRootPublisher, config);
        installRootPublisherKeyGen(em, rootTModelKeyGen, rootPartition, rootPublisher, nodeId);
        rootBusinessEntity.setBusinessKey(nodeId);
        installBusinessEntity(true, em, rootBusinessEntity, rootPublisher, rootPartition, config);
      } else {
        log.debug("juddi.seed.always reapplies all seed files except for the root data.");
      }
     
      List<String> juddiPublishers = getPublishers(config);
      for (String publisherStr : juddiPublishers) {
        String filePublisher = publisherStr + FILE_PUBLISHER;
        String fileTModelKeygen = publisherStr + FILE_TMODELKEYGEN;
        TModel tModelKeyGen = (TModel)buildInstallEntity(fileTModelKeygen, "org.uddi.api_v3", config);
        String fileBusinessEntity = publisherStr + FILE_BUSINESSENTITY;
        org.uddi.api_v3.BusinessEntity businessEntity = (org.uddi.api_v3.BusinessEntity)buildInstallEntity(fileBusinessEntity, "org.uddi.api_v3",config);
        UddiEntityPublisher publisher = installPublisher(em, filePublisher, config);
        if (publisher==null) {
          throw new ConfigurationException("File " + filePublisher + " not found.");
View Full Code Here

        //first check is Mary's business exists and delete
        DeleteIfExists("uddi:uddi.marypublisher.com:marybusinessone", uddi);

        System.out.println("making mary's tmodel key gen");
        //make the key gen since our test case uses some custom keys
        TModel createKeyGenator = UDDIClerk.createKeyGenator("uddi.marypublisher.com", "mary key gen", "en");
        //clerk.register(createKeyGenator);
        System.out.println("saving...");
        SaveTM(createKeyGenator, uddi);

View Full Code Here

    sp.setAuthInfo(rootAuthToken.getAuthInfo());
    juddiApi.savePublisher(sp);
    //END jUDDI specific code
               
    //Every publisher should have a keyGenerator, Joe has his:
    TModel keyGenerator = new TModel();
    keyGenerator.setTModelKey("uddi:uddi.joepublisher.com:keygenerator");
    Name name = new Name();
    name.setValue("Joe Publisher's Key Generator");
    keyGenerator.setName(name);
    Description description = new Description();
    description.setValue("This is the key generator for Joe Publisher's UDDI entities!");
    keyGenerator.getDescription().add(description);
    OverviewDoc overviewDoc = new OverviewDoc();
    OverviewURL overviewUrl = new OverviewURL();
    overviewUrl.setUseType("text");
    overviewUrl.setValue("http://uddi.org/pubs/uddi_v3.htm#keyGen");
    overviewDoc.setOverviewURL(overviewUrl);
    keyGenerator.getOverviewDoc().add(overviewDoc);
    CategoryBag categoryBag = new CategoryBag();
    KeyedReference keyedReference = new KeyedReference();
    keyedReference.setKeyName("uddi-org:types:keyGenerator");
    keyedReference.setKeyValue("keyGenerator");
    keyedReference.setTModelKey("uddi:uddi.org:categorization:types");
    categoryBag.getKeyedReference().add(keyedReference);
    keyGenerator.setCategoryBag(categoryBag);
    clerk.register(keyGenerator);
  }
View Full Code Here

                List<URL> urls = WADL2UDDI.getBaseAddresses(app);
                URL url = urls.get(0);
                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);
View Full Code Here

        GetAuthToken getAuthTokenRoot = new GetAuthToken();
        getAuthTokenRoot.setUserID("uddi");

        getAuthTokenRoot.setCred("uddi");
        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);
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.TModel

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.