Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessEntity


      List<BusinessInfo> biList = bInfos.getBusinessInfo();
      if (biList == null || biList.size() == 0)
        Assert.fail("No result from find business operation");
      BusinessInfo biOut = biList.get(0);
     
      BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(TckBusiness.JOE_BUSINESS_XML, "org.uddi.api_v3");
     
      assertEquals(beIn.getBusinessKey(), biOut.getBusinessKey());
     
      TckValidator.checkNames(beIn.getName(), biOut.getName());
      TckValidator.checkDescriptions(beIn.getDescription(), biOut.getDescription());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown.");
    }
View Full Code Here


  /**
   * Copies the BusinessInformation from one UDDI to another UDDI. Note that no services are being
   * copied over by this service. Use xRegisterService to copy over services.
   */
  public void xRegisterBusiness() {
    BusinessEntity businessEntity;
    try {
      businessEntity = fromClerk.findBusiness(entityKey,fromClerk.getUDDINode().getApiNode());
      log.info("xregister business " + businessEntity.getName().get(0).getValue() + " + from "
          + fromClerk.getName() + " to " + toClerk.getName() + ".");
      //not bringing over the services. They need to be explicitly copied using xRegisterService.
      businessEntity.setBusinessServices(null);
      toClerk.register(businessEntity,toClerk.getUDDINode().getApiNode());
    } catch (Exception e) {
      log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e);
    }
  }
View Full Code Here

 
  /**
   * Copies the BusinessInformation from one UDDI to another UDDI.
   */
  public void xRegisterBusinessAndServices() {
    BusinessEntity businessEntity;
    try {
      businessEntity = fromClerk.findBusiness(entityKey,fromClerk.getUDDINode().getApiNode());
      log.info("xregister business " + businessEntity.getName().get(0).getValue() + " + from "
          + fromClerk.getName() + " to " + toClerk.getName() + " including all services owned by this business.");
      toClerk.register(businessEntity,toClerk.getUDDINode().getApiNode());
    } catch (Exception e) {
      log.error("Could not " + toString() + ". " + e.getMessage() + " " + e.getCause(),e);
    }
View Full Code Here

 
  static UDDIClient uddiClient;
 
  public void publishBusiness(UDDIClerk clerk) {
    // Creating the parent business entity that will contain our service.
    BusinessEntity myBusEntity = new BusinessEntity();
    Name myBusName = new Name();
    myBusName.setValue("WSDL-Business");
    myBusEntity.getName().add(myBusName);
    myBusEntity.setBusinessKey("uddi:uddi.joepublisher.com:business-for-wsdl");
    clerk.register(myBusEntity);
 
View Full Code Here

  public void find() {
    try {
      UDDIClient uddiClient = new UDDIClient("META-INF/wsdl2uddi-uddi.xml");
      UDDIClerk clerk = uddiClient.getClerk("joe");
         
          BusinessEntity businessEntity = clerk.findBusiness("uddi:uddi.joepublisher.com:business-for-wsdl");
          //
          if (businessEntity!=null) {
            System.out.println("Found business with name " + businessEntity.getName().get(0).getValue());
            System.out.println("Number of services: " + businessEntity.getBusinessServices().getBusinessService().size());
           
            for (BusinessService businessService: businessEntity.getBusinessServices().getBusinessService()) {
              System.out.println("Service Name        = '" + businessService.getName().get(0).getValue() + "'");
              System.out.println("Service Key         = '" + businessService.getServiceKey() + "'");
              System.out.println("Service Description = '" + businessService.getDescription().get(0).getValue() + "'");
              System.out.println("BindingTemplates: " + businessService.getBindingTemplates().getBindingTemplate().size());
             
              for (int i=0; i<businessService.getBindingTemplates().getBindingTemplate().size(); i++) {
              BindingTemplate bindingTemplate = businessService.getBindingTemplates().getBindingTemplate().get(i);
              System.out.println("--BindingTemplate" + " " + i + ":");
              System.out.println("  bindingKey          = " + bindingTemplate.getBindingKey());
              System.out.println("  accessPoint useType = " + bindingTemplate.getAccessPoint().getUseType());
              System.out.println("  accessPoint value   = " + bindingTemplate.getAccessPoint().getValue());
              System.out.println("  description         = " + bindingTemplate.getDescription().get(0).getValue());
              }
            }
          }
             
          businessEntity.getBusinessServices();
         
          //TODO JUDDI-610
      //FindTModel findBindingTModel = WSDL2UDDI.createFindBindingTModelForPortType(portType, namespace);
     
    }
View Full Code Here

   * Register a service.
   * returns null if not successful
   */
  public BusinessEntity register(BusinessEntity business, Node node) {
   
    BusinessEntity businessEntity=null;
    log.info("Registering business " + business.getName().get(0).getValue()
        + " with key " + business.getBusinessKey());
    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);
      if (log.isDebugEnabled()) log.debug("Registering businessEntity " + businessEntity.getName().get(0).getValue() + " completed.");
    } 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

    checkNumberOfServices(JOE_BUSINESS3_KEY,expectedNumberOfServices);
  }
  
  public void saveBusinesses(String authInfo, String businessXML, String businessKey, int numberOfCopies) {
    try {     
      BusinessEntity beIn = (BusinessEntity)EntityCreator.buildFromDoc(businessXML, "org.uddi.api_v3");
      String businessName = beIn.getName().get(0).getValue();
      for (int i=0; i<numberOfCopies; i++) {
        SaveBusiness sb = new SaveBusiness();
        sb.setAuthInfo(authInfo);
        beIn.getName().get(0).setValue(businessName + "-" + i);
        beIn.setBusinessKey(businessKey + "-" + i);
        sb.getBusinessEntity().add(beIn);
        publication.saveBusiness(sb);
        logger.debug("Saved business with key " + businessName + "-" + i);
      }
     
View Full Code Here

      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());
      }
    } catch (RemoteException e) {
      logger.error(e.getMessage(),e);
      Assert.fail("No exception should be thrown");
    }
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);
                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

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.