Package com.sun.xml.registry.uddi.bindings_v2_2

Examples of com.sun.xml.registry.uddi.bindings_v2_2.TModel


    /**
     * Create an instance of {@link TModelInstanceInfo }
     *
     */
    public TModelInstanceInfo createTModelInstanceInfo() {
        return new TModelInstanceInfo();
    }
View Full Code Here


    /**
     * Create an instance of {@link TModelList }
     *
     */
    public TModelList createTModelList() {
        return new TModelList();
    }
View Full Code Here

    /**
     * Create an instance of {@link ValidateValues }
     *
     */
    public ValidateValues createValidateValues() {
        return new ValidateValues();
    }
View Full Code Here

        return bs;
    }

  public static TModel getTModelFromJAXRClassificationScheme(
      ClassificationScheme classificationScheme) throws JAXRException {
    TModel tm = objectFactory.createTModel();
    try {
            /*
             * a fresh scheme might not have a key
             */

            Key k = classificationScheme.getKey();

            if (k != null && k.getId() != null) {
                tm.setTModelKey(k.getId());
            } else {
                tm.setTModelKey("");
            }

            /*
             * There's no reason to believe these are here either
             */

            Slot s = classificationScheme.getSlot("authorizedName");

      if (s != null && s.getName() != null) {
                tm.setAuthorizedName(s.getName());
            }

            s = classificationScheme.getSlot("operator");

      if (s != null && s.getName() != null) {
                tm.setOperator(s.getName());
            }

      InternationalString iname = classificationScheme.getName();
      
            tm.setName(getFirstName(iname));

      InternationalString idesc = classificationScheme.getDescription();
     
        addDescriptions(tm.getDescription(), idesc);

            IdentifierBag idBag = getIdentifierBagFromExternalIdentifiers(classificationScheme.getExternalIdentifiers());
            if (idBag!=null) {
                tm.setIdentifierBag(idBag);
            }
            CategoryBag catBag = getCategoryBagFromClassifications(classificationScheme.getClassifications());
            if (catBag!=null) {
                tm.setCategoryBag(catBag);
            }
     
      // ToDO: overviewDoc
    } catch (Exception ud) {
            throw new JAXRException("Apache JAXR Impl:", ud);
View Full Code Here

        return tm;
    }

    public static TModel getTModelFromJAXRConcept(Concept concept)
      throws JAXRException {
      TModel tm = objectFactory.createTModel();
    if (concept == null)
      return null;
    try {
            Key key = concept.getKey();
      if (key != null && key.getId() != null)
        tm.setTModelKey(key.getId());
            Slot sl1 = concept.getSlot("authorizedName");
      if (sl1 != null && sl1.getName() != null)
        tm.setAuthorizedName(sl1.getName());

            Slot sl2 = concept.getSlot("operator");
      if (sl2 != null && sl2.getName() != null)
        tm.setOperator(sl2.getName());

      InternationalString iname = concept.getName();

            tm.setName(getFirstName(iname));

            InternationalString idesc = concept.getDescription();
     
            addDescriptions(tm.getDescription(), idesc);

//          External Links
            Collection<ExternalLink> externalLinks = concept.getExternalLinks();
            if(externalLinks != null && externalLinks.size() > 0)
            {
                tm.setOverviewDoc(getOverviewDocFromExternalLink((ExternalLink)externalLinks.iterator().next()));
           

            IdentifierBag idBag = getIdentifierBagFromExternalIdentifiers(concept.getExternalIdentifiers());
            if (idBag!=null) {
                tm.setIdentifierBag(idBag);
            }
            CategoryBag catBag = getCategoryBagFromClassifications(concept.getClassifications());
            if (catBag!=null) {
                tm.setCategoryBag(catBag);
            }

    } catch (Exception ud) {
            throw new JAXRException("Apache JAXR Impl:", ud);
        }
View Full Code Here

        Iterator iter = schemes.iterator();
        int currLoc = 0;
        while (iter.hasNext()) {
            try {
                TModel en =
                        ScoutJaxrUddiHelper.getTModelFromJAXRClassificationScheme((ClassificationScheme) iter.next());
                entityarr[currLoc] = en;
                currLoc++;
            }
            catch (ClassCastException ce) {
                throw new UnexpectedObjectException();
            }
        }
        log.debug("Method:save_classificationscheme: ENlength=" + entityarr.length);
        // Save business
        TModelDetail td = null;
        try {
            td = (TModelDetail) executeOperation(entityarr, "SAVE_TMODEL");
        }
        catch (RegistryException e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        List<TModel> tmodelList = td.getTModel();
        entityarr = new TModel[tmodelList.size()];
        tmodelList.toArray(entityarr);
        log.debug("After Saving TModel. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
        for (int i = 0; entityarr != null && i < entityarr.length; i++) {
            TModel tm = (TModel) entityarr[i];
            coll.add(new KeyImpl(tm.getTModelKey()));
        }

        bulk.setCollection(coll);
        bulk.setExceptions(exceptions);
View Full Code Here

        Iterator iter = concepts.iterator();
        int currLoc = 0;
        while (iter.hasNext()) {
            try {
                TModel en =
                        ScoutJaxrUddiHelper.getTModelFromJAXRConcept((Concept) iter.next());
                entityarr[currLoc] = en;
                currLoc++;
            }
            catch (ClassCastException ce) {
                throw new UnexpectedObjectException();
            }
        }
        log.debug("Method:save_concept: ENlength=" + entityarr.length);
        // Save business
        TModelDetail td = null;
        try {
            td = (TModelDetail) executeOperation(entityarr, "SAVE_TMODEL");
        }
        catch (RegistryException e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        List<TModel> tmodelList = td.getTModel();
        entityarr = new TModel[tmodelList.size()];
        tmodelList.toArray(entityarr);
       
        log.debug("After Saving TModel. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
        for (int i = 0; entityarr != null && i < entityarr.length; i++) {
            TModel tm = (TModel) entityarr[i];
            coll.add(new KeyImpl(tm.getTModelKey()));
        }

        bulk.setCollection(coll);
        bulk.setExceptions(exceptions);
View Full Code Here

      List<TModelInfo> tiList = tInfos.getTModelInfo();
      if (tiList == null || tiList.size() == 0)
        Assert.fail("No result from find tModel operation");
      TModelInfo tiOut = tiList.get(0);
     
      TModel tmIn = (TModel)EntityCreator.buildFromDoc(TckTModel.JOE_PUBLISHER_TMODEL_XML, "org.uddi.api_v3");
     
      assertEquals(tmIn.getTModelKey(), tiOut.getTModelKey());
      assertEquals(tmIn.getName().getLang(), tiOut.getName().getLang());
      assertEquals(tmIn.getName().getValue(), tiOut.getName().getValue());

      TckValidator.checkDescriptions(tmIn.getDescription(), tiOut.getDescription());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown.");
    }
View Full Code Here

      if (!seedAlways && alreadyInstalled(config))
        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;
      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);
     
      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

        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

TOP

Related Classes of com.sun.xml.registry.uddi.bindings_v2_2.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.