Package org.uddi.api_v2

Examples of org.uddi.api_v2.ServiceDetail


        // Store deleted keys in the results
        if (missingKeyBag.getServiceKey() != null && missingKeyBag.getServiceKey().size() > 0)
          result.getKeyBag().add(missingKeyBag);
 
        KeyBag resultsKeyBag = new KeyBag();
        ServiceDetail serviceDetail = new ServiceDetail();
       
        // Set the currentIndex to 0 or the value of the chunkData
        int currentIndex = 0;
        if (chunkData != null)
          currentIndex = chunkData;
       
        int returnedRowCount = 0;
        while(currentIndex < existingList.size()) {
         
          org.apache.juddi.model.BusinessService modelBusinessService = existingList.get(currentIndex);
           
          if (startPointDate.after(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (endPointDate.before(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (modelSubscription.isBrief()) {
            resultsKeyBag.getServiceKey().add(modelBusinessService.getEntityKey());
          }
          else {
            org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
            MappingModelToApi.mapBusinessService(modelBusinessService, apiBusinessService);
            serviceDetail.getBusinessService().add(apiBusinessService);
           
            returnedRowCount++;
          }
 
          // If the returned rows equals the max allowed, we can end the loop.
View Full Code Here


      }
    }
    //SERVICE DETAIL
    if (list.getServiceDetail()!=null) {
      log.info("Subscription result for ServiceDetail with subscription key=" + list.getSubscription().getSubscriptionKey());
      ServiceDetail serviceDetail = list.getServiceDetail();
      if (serviceDetail.isTruncated()) {
        log.info("The serviceDetail is truncated, the maxEntries must have been hit. The number of services is " + serviceDetail.getBusinessService().size());
      }
      for (BusinessService service : serviceDetail.getBusinessService()) {
        BusinessEntity existingBusinessEntity = null;
        try {
          if (existingBusinessEntity==null) {
            existingBusinessEntity = uddiToClerk.findBusiness(service.getBusinessKey(), toClerk.getNode());
          }
View Full Code Here

      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      ValidatePublish validator = new ValidatePublish(publisher);
      validator.validateSaveService(em, body, null);
     
      ServiceDetail result = new ServiceDetail();
 
      List<org.uddi.api_v3.BusinessService> apiBusinessServiceList = body.getBusinessService();
      for (org.uddi.api_v3.BusinessService apiBusinessService : apiBusinessServiceList) {
       
        org.apache.juddi.model.BusinessService modelBusinessService = new org.apache.juddi.model.BusinessService();
        org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
        modelBusinessEntity.setEntityKey(apiBusinessService.getBusinessKey());
       
        MappingApiToModel.mapBusinessService(apiBusinessService, modelBusinessService, modelBusinessEntity);
 
        setOperationalInfo(em, modelBusinessService, publisher, false);

        em.persist(modelBusinessService);
       
        result.getBusinessService().add(apiBusinessService);
       
        validator.validateSaveServiceMax(em, modelBusinessService.getBusinessEntity().getEntityKey());
      }
     
     
View Full Code Here

    try {
      GetServiceDetail getServiceDetail = new GetServiceDetail();
      getServiceDetail.getServiceKey().add(serviceKey);
     
     
      ServiceDetail result = inquiry.getServiceDetail(getServiceDetail);
     
      if (result == null)
        Assert.fail("Null result from find service operation");
     
      BindingTemplates templates = result.getBusinessService().get(0).getBindingTemplates();
      if (templates!=null && templates.getBindingTemplate()!=null) {
        System.out.println(templates.getBindingTemplate().size());
        System.out.println("key=" + templates.getBindingTemplate().get(0).getBindingKey());
      }
//      ServiceInfos sInfos = result.getServiceInfos();
View Full Code Here

                                        btIn.getAccessPoint().setValue(value);
                                        logger.info("service " + bsIn.getServiceKey() + " access point " + btIn.getAccessPoint().getValue() + " key:" + btIn.getBindingKey());
                                }
                        //}
                        ss.getBusinessService().add(bsIn);
                        ServiceDetail bsOut = publication.saveService(ss);
                        Assert.assertNotNull(bsOut);
                        Assert.assertEquals(bsOut.getBusinessService().get(0).getBusinessKey(), bsIn.getBusinessKey());
                        if (bsIn.getBindingTemplates() != null) {
                                Assert.assertNotNull(bsOut.getBusinessService().get(0).getBindingTemplates());
                                Assert.assertEquals(bsOut.getBusinessService().get(0).getBindingTemplates().getBindingTemplate().size(), bsIn.getBindingTemplates().getBindingTemplate().size());
                                for (int i=0; i < bsIn.getBindingTemplates().getBindingTemplate().size(); i++) {
                                        Assert.assertEquals(bsIn.getBindingTemplates().getBindingTemplate().get(i).getAccessPoint().getValue(),
                                                bsOut.getBusinessService().get(0).getBindingTemplates().getBindingTemplate().get(i).getAccessPoint().getValue());
                                       
                                }
                        }
                        Assert.assertEquals(bsOut.getBusinessService().get(0).getServiceKey(), bsIn.getServiceKey());
                        logger.info("service " + bsIn.getServiceKey() + " saved");

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

      tx.begin();

      if (isAuthenticated())
        this.getEntityPublisher(em, body.getAuthInfo());

      ServiceDetail result = new ServiceDetail();

      List<String> serviceKeyList = body.getServiceKey();
      for (String serviceKey : serviceKeyList) {
        org.apache.juddi.model.BusinessService modelBusinessService = null;
        try {
          modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, serviceKey);
        } catch (ClassCastException e){}
        if (modelBusinessService == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.ServiceNotFound", serviceKey));

        org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();

        MappingModelToApi.mapBusinessService(modelBusinessService, apiBusinessService);

        result.getBusinessService().add(apiBusinessService);
      }

      tx.commit();
                        long procTime = System.currentTimeMillis() - startTime;
                        serviceCounter.update(InquiryQuery.GET_SERVICEDETAIL, QueryStatus.SUCCESS, procTime);                     
View Full Code Here

      publication.saveService(ss);
     
      // Now get the entity and check the values
      GetServiceDetail gs = new GetServiceDetail();
      gs.getServiceKey().add(serviceKey);
      ServiceDetail sd = inquiry.getServiceDetail(gs);
      List<BusinessService> bsOutList = sd.getBusinessService();
      BusinessService bsOut = bsOutList.get(0);

      assertEquals(bsIn.getServiceKey().toLowerCase(), bsOut.getServiceKey());
     
      TckValidator.checkNames(bsIn.getName(), bsOut.getName());
View Full Code Here

     
      // Now get the entity and check the values
      GetServiceDetail gs = new GetServiceDetail();
      gs.getServiceKey().add(serviceKey);
      gs.getServiceKey().add(serviceKey2);
      ServiceDetail sd = inquiry.getServiceDetail(gs);
      List<BusinessService> bsOutList = sd.getBusinessService();
      int size = bsOutList.size();

      assertEquals(2, size);
     
     
View Full Code Here

      }
    }
    //SERVICE DETAIL
    if (list.getServiceDetail()!=null) {
      log.info("Subscription result for ServiceDetail with subscription key=" + list.getSubscription().getSubscriptionKey());
      ServiceDetail serviceDetail = list.getServiceDetail();
      if (serviceDetail.isTruncated()) {
        log.info("The serviceDetail is truncated, the maxEntries must have been hit. The number of services is " + serviceDetail.getBusinessService().size());
      }
      for (BusinessService service : serviceDetail.getBusinessService()) {
        BusinessEntity existingBusinessEntity = null;
        try {
          if (existingBusinessEntity==null) {
            existingBusinessEntity = uddiToClerk.findBusiness(service.getBusinessKey(), toClerk.getNode());
          }
View Full Code Here

        // Store deleted keys in the results
        if (missingKeyBag.getServiceKey() != null && missingKeyBag.getServiceKey().size() > 0)
          result.getKeyBag().add(missingKeyBag);
 
        KeyBag resultsKeyBag = new KeyBag();
        ServiceDetail serviceDetail = new ServiceDetail();
       
        // Set the currentIndex to 0 or the value of the chunkData
        int currentIndex = 0;
        if (chunkData != null)
          currentIndex = chunkData;
       
        int returnedRowCount = 0;
        while(currentIndex < existingList.size()) {
         
          org.apache.juddi.model.BusinessService modelBusinessService = existingList.get(currentIndex);
           
          if (startPointDate.after(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (endPointDate.before(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (modelSubscription.isBrief()) {
            resultsKeyBag.getServiceKey().add(modelBusinessService.getEntityKey());
          }
          else {
            org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
            MappingModelToApi.mapBusinessService(modelBusinessService, apiBusinessService);
            serviceDetail.getBusinessService().add(apiBusinessService);
           
            returnedRowCount++;
          }
 
          // If the returned rows equals the max allowed, we can end the loop.
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.ServiceDetail

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.