Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessEntity


                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();
                        sb.setAuthInfo(authInfo);
                        sb.getBusinessEntity().add(bizEntitySigned);
                        publication.saveBusiness(sb);
View Full Code Here


                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) {
                        logger.error(e.getMessage(), e);
View Full Code Here

                logger.info("attempting to save business " + businessKey + " from " + businessXML);
                try {
                        SaveBusiness sb = new SaveBusiness();
                        sb.setAuthInfo(authInfo);

                        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"));
                        }

                        assertEquals(beIn.getBusinessKey(), beOut.getBusinessKey());

                        TckValidator.checkNames(beIn.getName(), beOut.getName());
                        TckValidator.checkDescriptions(beIn.getDescription(), beOut.getDescription());
                        TckValidator.checkDiscoveryUrls(beIn.getDiscoveryURLs(), beOut.getDiscoveryURLs());
                        TckValidator.checkContacts(beIn.getContacts(), beOut.getContacts());
                        TckValidator.checkCategories(beIn.getCategoryBag(), beOut.getCategoryBag());
                        TckValidator.checkSignatures(beIn.getSignature(), beOut.getSignature());
                        return beOut;
                } catch (Throwable e) {
                        logger.error(e.getMessage(), e);
                        Assert.fail("No exception should be thrown");
                }
View Full Code Here

                        // 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());
                        assertEquals(2, beOutNew.getBusinessServices().getBusinessService().size());

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

    getAuthenticationToken.run();
   
    //Get the AuthToken
    AuthToken authToken= getAuthenticationToken.getAuthenticationToken();
   
    BusinessEntity businessEntity;
   
    // If there are no businesses in the data pool submit one with a rate of 100
    // to ensure that it will be entered
    if(dataPool.getSize() <= 10)
    {
View Full Code Here

       
    }
    else
    {
      //Get a business entity from the pool.
      BusinessEntity businessEntity= dataPool.getDataElement();
     
      if (businessEntity == null)
      {
        //Pick a company name from a previously generated list of business names.
        String businessName = data.getCompany(false);
       
        //Register the business with services
        RegisterBusinessFlow registerBusinessFlow = new RegisterBusinessFlow(getAuthenticationToken.getAuthenticationToken(),
            businessName, numberOfBusinessService);
       
        Thread.sleep(4000);
       
        //Add the returnThread.sleep(8000);ed BusinessEntity to the data pool.
        dataPool.add(registerBusinessFlow.getBusinessDetail().getBusinessEntity().get(0), 100);
      }
      else
      {
        //Find the random business by passing it's name and the AuthToken.
        FindBusinessByName findBusinessByName = new FindBusinessByName(getAuthenticationToken.getAuthenticationToken(),
            businessEntity.getName().get(0).getValue());
        findBusinessByName.run();
       
        //Offer the business entity back to the pool with 50% chance that it will be rejected
        //if the pool is full.
        dataPool.add(businessEntity);
View Full Code Here

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

      assertEquals(beIn.getBusinessKey(), beOut.getBusinessKey());
     
      TckValidator.checkNames(beIn.getName(), beOut.getName());
      TckValidator.checkDescriptions(beIn.getDescription(), beOut.getDescription());
      TckValidator.checkDiscoveryUrls(beIn.getDiscoveryURLs(), beOut.getDiscoveryURLs());
      TckValidator.checkContacts(beIn.getContacts(), beOut.getContacts());
      TckValidator.checkCategories(beIn.getCategoryBag(), beOut.getCategoryBag());
     
      List<KeyBag> keyBagList = result.getKeyBag();
      if (keyBagList == null || keyBagList.size() == 0)
        Assert.fail("No keyBag from SamSyndicator getSubscriptionResults operation");
      KeyBag keyBag = keyBagList.get(0);
View Full Code Here

        Iterator iter = organizations.iterator();
        int currLoc = 0;
        while (iter.hasNext()) {
            try {
                BusinessEntity en =
                  ScoutJaxrUddiV3Helper.getBusinessEntityFromJAXROrg((Organization) iter.next());
                entityarr[currLoc] = en;
                currLoc++;
            }
            catch (ClassCastException ce) {
                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);
        for (int i = 0; entityarr != null && i < entityarr.length; i++) {
            BusinessEntity entity = (BusinessEntity) entityarr[i];
            coll.add(new KeyImpl(entity.getBusinessKey()));
        }

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

      request.setAuthInfo(authInfo);
    }
     
    if (businessArray != null) {
      for (int i = 0; i < businessArray.length; i++) {
        BusinessEntity be = businessArray[i];
        if (be.getBusinessServices().getBusinessService().size() == 0) {
          be.setBusinessServices(null);
        }
      }

      request.getBusinessEntity().addAll(Arrays.asList(businessArray));
    }
View Full Code Here

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

      assertEquals(beIn.getBusinessKey(), beOut.getBusinessKey());
     
      TckValidator.checkNames(beIn.getName(), beOut.getName());
      TckValidator.checkDescriptions(beIn.getDescription(), beOut.getDescription());
      TckValidator.checkDiscoveryUrls(beIn.getDiscoveryURLs(), beOut.getDiscoveryURLs());
      TckValidator.checkContacts(beIn.getContacts(), beOut.getContacts());
      TckValidator.checkCategories(beIn.getCategoryBag(), beOut.getCategoryBag());
     
      List<KeyBag> keyBagList = result.getKeyBag();
      if (keyBagList == null || keyBagList.size() == 0)
        Assert.fail("No keyBag from SamSyndicator getSubscriptionResults operation");
      KeyBag keyBag = keyBagList.get(0);
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.BusinessEntity

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.