Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessDetail


    InquiryResponse response = new InquiryResponse();
    logger.debug("BusinessDetail " + getBusinessDetail + " sending businessDetail request..");
    try {
       Transport transport = WebHelper.getTransport(session.getServletContext());
           UDDIInquiryPortType inquiryService = transport.getUDDIInquiryService();
           BusinessDetail businessDetail = inquiryService.getBusinessDetail(getBusinessDetail);
           for (BusinessEntity businessEntity : businessDetail.getBusinessEntity()) {
             Business business = new Business(
                 businessEntity.getBusinessKey(),
                 EntityForLang.getName(businessEntity.getName(),lang).getValue(),
                 EntityForLang.getDescription(businessEntity.getDescription(),lang).getValue());
             if (businessEntity.getBusinessServices()!=null) {
View Full Code Here


  public void getNonExitingBusiness() {
    String nonExistingKey = "nonexistingKey";
    try {
      GetBusinessDetail body = new GetBusinessDetail();
      body.getBusinessKey().add(nonExistingKey);
      BusinessDetail  result = inquiry.getBusinessDetail(body);
      Assert.fail("No business should be found");
      System.out.println(result.getBusinessEntity().size());
    } catch (Exception e) {
      try {
        DispositionReport report = DispositionReportFaultMessage.getDispositionReport(e);
        assertNotNull(report);
        assertTrue(report.countainsErrorCode(DispositionReport.E_INVALID_KEY_PASSED));
View Full Code Here

     
      SubscriptionResultsList result = subscription.getSubscriptionResults(getSubResultsIn);
      if (result == null)
        Assert.fail("Null result from getSubscriptionResults operation");

      BusinessDetail busDetail = result.getBusinessDetail();
      if (busDetail == null)
        Assert.fail("No result from getSubscriptionResults operation");
      List<BusinessEntity> beList = busDetail.getBusinessEntity();
      if (beList == null || beList.size() == 0)
        Assert.fail("No result from getSubscriptionResults operation");
      BusinessEntity beOut = beList.get(0);
     
      BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.SAM_BUSINESS_XML, "org.uddi.api_v3");
View Full Code Here

      publication.saveBusiness(sb);
 
      // Now get the entity and check the values
      GetBusinessDetail gb = new GetBusinessDetail();
      gb.getBusinessKey().add(businessKey);
      BusinessDetail bd = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutList = bd.getBusinessEntity();
      BusinessEntity beOut = beOutList.get(0);

      assertEquals(beIn.getBusinessKey(), beOut.getBusinessKey());
     
      TckValidator.checkNames(beIn.getName(), beOut.getName());
View Full Code Here

    try {
     
      // Now get the entity and check the values
      GetBusinessDetail gb = new GetBusinessDetail();
      gb.getBusinessKey().add(businessKey);
      BusinessDetail bd = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutList = bd.getBusinessEntity();
      BusinessEntity beOut = beOutList.get(0);
      //We are expecting 2 services
      assertEquals(2,beOut.getBusinessServices().getBusinessService().size());
     
      //Now updating the business by adding another description
      SaveBusiness sb = new SaveBusiness();
      sb.setAuthInfo(authInfo);
      BusinessEntity beIn = beOut;
      Description desc2= new Description();
      desc2.setLang("nl");
      desc2.setValue("Omschrijving");
      beIn.getDescription().add(desc2);
      sb.getBusinessEntity().add(beIn);
      publication.saveBusiness(sb);
 
      // Now get the entity and check the values
      BusinessDetail bdnew = inquiry.getBusinessDetail(gb);
      List<BusinessEntity> beOutListNew = bdnew.getBusinessEntity();
      BusinessEntity beOutNew = beOutListNew.get(0);

      assertEquals(beIn.getBusinessKey(), beOutNew.getBusinessKey());
      // After the update we still are supposed to see two services.
      assertNotNull(beOutNew.getBusinessServices());
View Full Code Here

    try {
      String authToken = getAuthToken(node.getSecurityUrl());
      SaveBusiness saveBusiness = new SaveBusiness();
      saveBusiness.setAuthInfo(authToken);
      saveBusiness.getBusinessEntity().add(business);
      BusinessDetail businessDetail = getUDDINode().getTransport().getUDDIPublishService(node.getPublishUrl()).saveBusiness(saveBusiness);
      businessEntity = businessDetail.getBusinessEntity().get(0);
    } catch (Exception e) {
      log.error("Unable to register business " + business.getName().get(0).getValue()
          + " ." + e.getMessage(),e);
    } catch (Throwable t) {
      log.error("Unable to register business " + business.getName().get(0).getValue()
View Full Code Here

      TransportException, ConfigurationException  {
    GetBusinessDetail getBusinessDetail = new GetBusinessDetail();
    getBusinessDetail.getBusinessKey().add(businessKey);
    getBusinessDetail.setAuthInfo(node.getSecurityUrl());
    try {
      BusinessDetail bd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getBusinessDetail(getBusinessDetail);
      return bd.getBusinessEntity().get(0);
    } catch (DispositionReportFaultMessage dr) {
      DispositionReport report = DispositionReportFaultMessage.getDispositionReport(dr);
      checkForErrorInDispositionReport(report, DispositionReport.E_INVALID_KEY_PASSED, businessKey);
    } catch (SOAPFaultException sfe) {
      DispositionReport report = DispositionReportFaultMessage.getDispositionReport(sfe);
View Full Code Here

        // Store deleted keys in the results
        if (missingKeyBag.getBusinessKey() != null && missingKeyBag.getBusinessKey().size() > 0)
          result.getKeyBag().add(missingKeyBag);
       
        KeyBag resultsKeyBag = new KeyBag();
        BusinessDetail businessDetail = new BusinessDetail();
 
        // 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.BusinessEntity modelBusinessEntity = existingList.get(currentIndex);
 
          if (startPointDate.after(modelBusinessEntity.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (endPointDate.before(modelBusinessEntity.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (modelSubscription.isBrief()) {
            resultsKeyBag.getBusinessKey().add(modelBusinessEntity.getEntityKey());
          }
          else {
            org.uddi.api_v3.BusinessEntity apiBusinessEntity = new org.uddi.api_v3.BusinessEntity();
            MappingModelToApi.mapBusinessEntity(modelBusinessEntity, apiBusinessEntity);
            businessDetail.getBusinessEntity().add(apiBusinessEntity);
           
            returnedRowCount++;
          }
 
          // If the returned rows equals the max allowed, we can end the loop.
View Full Code Here

      tx.begin();

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

      BusinessDetail result = new BusinessDetail();

      List<String> businessKeyList = body.getBusinessKey();
      for (String businessKey : businessKeyList) {

        org.apache.juddi.model.BusinessEntity modelBusinessEntity = em.find(org.apache.juddi.model.BusinessEntity.class, businessKey);
        if (modelBusinessEntity == null)
          throw new InvalidKeyPassedException(new ErrorMessage("errors.invalidkey.BusinessNotFound", businessKey));

        org.uddi.api_v3.BusinessEntity apiBusinessEntity = new org.uddi.api_v3.BusinessEntity();

        MappingModelToApi.mapBusinessEntity(modelBusinessEntity, apiBusinessEntity);

        result.getBusinessEntity().add(apiBusinessEntity);
      }

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

     
      UddiEntityPublisher publisher = this.getEntityPublisher(em, body.getAuthInfo());
     
      new ValidatePublish(publisher).validateSaveBusiness(em, body, null);
 
      BusinessDetail result = new BusinessDetail();
     
      List<org.uddi.api_v3.BusinessEntity> apiBusinessEntityList = body.getBusinessEntity();
      for (org.uddi.api_v3.BusinessEntity apiBusinessEntity : apiBusinessEntityList) {
       
        org.apache.juddi.model.BusinessEntity modelBusinessEntity = new org.apache.juddi.model.BusinessEntity();
       
        MappingApiToModel.mapBusinessEntity(apiBusinessEntity, modelBusinessEntity);
       
        setOperationalInfo(em, modelBusinessEntity, publisher);
 
        em.persist(modelBusinessEntity);
 
        result.getBusinessEntity().add(apiBusinessEntity);
      }
 
      tx.commit();
      return result;
    } finally {
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.BusinessDetail

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.