Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessDetail


        // 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


        public void checkNumberOfServices(String businessKey, int expectedServices) {

                try {
                        GetBusinessDetail gb = new GetBusinessDetail();
                        gb.getBusinessKey().add(businessKey);
                        BusinessDetail bd;
                        bd = inquiry.getBusinessDetail(gb);
                        List<BusinessEntity> beOutList = bd.getBusinessEntity();
                        BusinessEntity beOut = beOutList.get(0);
                        if (expectedServices > 0) {
                                assertEquals(expectedServices, beOut.getBusinessServices().getBusinessService().size());
                        } else {
                                Assert.assertNull(beOut.getBusinessServices());
View Full Code Here

        public void signBusiness(String authInfo, String businessKey) {
                try {
                        GetBusinessDetail gb = new GetBusinessDetail();
                        gb.getBusinessKey().add(businessKey);
                        BusinessDetail bd = inquiry.getBusinessDetail(gb);
                        List<BusinessEntity> beOutList = bd.getBusinessEntity();
                        BusinessEntity bizEntity = beOutList.get(0);
                        bizEntity.getSignature().clear();
                        BusinessEntity bizEntitySigned = signJAXBObject(bizEntity);

                        SaveBusiness sb = new SaveBusiness();
View Full Code Here

        public void verifyBusinessSignature(String authInfo, String businessKey) {
                try {
                        GetBusinessDetail gb = new GetBusinessDetail();
                        gb.getBusinessKey().add(businessKey);
                        BusinessDetail bd = inquiry.getBusinessDetail(gb);
                        List<BusinessEntity> beOutList = bd.getBusinessEntity();
                        BusinessEntity bizEntity = beOutList.get(0);

                        boolean sigOk = verifySignedJAXBObject(bizEntity);
                        assertTrue("Signature invalid!", sigOk);
                } catch (Throwable e) {
View Full Code Here

                        BusinessEntity beIn = (BusinessEntity) EntityCreator.buildFromDoc(businessXML, "org.uddi.api_v3");
                        if (beIn == null) {
                                throw new Exception("Unload to load source xml document from " + businessXML);
                        }
                        sb.getBusinessEntity().add(beIn);
                        BusinessDetail saveBusiness = publication.saveBusiness(sb);
                        logger.info("Business saved with key " + saveBusiness.getBusinessEntity().get(0).getBusinessKey());
                        if (serialize) {
                                JAXB.marshal(saveBusiness, System.out);
                        }

                        // 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);

                        if (serialize) {
                                JAXB.marshal(beOut, new File("target/aftersave.xml"));
                        }
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

     
      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

        private boolean BusinessExists(String businessKey, String token) {
                GetBusinessDetail r = new GetBusinessDetail();
                r.setAuthInfo(token);
                r.getBusinessKey().add(businessKey);
                try {
                        BusinessDetail tModelDetail = inquiry.getBusinessDetail(r);
                        if (tModelDetail != null && !tModelDetail.getBusinessEntity().isEmpty()) {
                                return true;
                        }
                } catch (Exception ex) {
                }
                return false;
View Full Code Here

                throw new UnexpectedObjectException();
            }
        }
        log.debug("Method:save_business: ENlength=" + entityarr.length);
        // Save business
        BusinessDetail bd = null;
        try {
            bd = (BusinessDetail) executeOperation(entityarr, "SAVE_ORG");
        }
        catch (RegistryV3Exception e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        List<BusinessEntity> bizEntityList = bd.getBusinessEntity();
       
        entityarr = new BusinessEntity[bizEntityList.size()];
        bizEntityList.toArray(entityarr);
       
        log.debug("After Saving Business. Obtained vector size:" + entityarr != null ? entityarr.length : 0);
View Full Code Here

    if (businessKeyArray != null) {
      request.getBusinessKey().addAll(Arrays.asList(businessKeyArray));
    }

        BusinessDetail bd = null;
        JAXBElement<?> o = execute(this.objectFactory.createGetBusinessDetail(request),
            this.getInquiryURI());
        bd = (BusinessDetail) o.getValue();
        return bd;
  }
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.