Package org.apache.ws.scout.model.uddi.v2

Examples of org.apache.ws.scout.model.uddi.v2.BusinessDetail


      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 = null;
        try {
          modelBusinessEntity = em.find(org.apache.juddi.model.BusinessEntity.class, businessKey);
        } catch (ClassCastException e) {}
        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


    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) {
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

  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

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

            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

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

            bs.setBindingTemplates(new BindingTemplates());
            bs.getBindingTemplates().getBindingTemplate().add(bt);
            be.setBusinessServices(new BusinessServices());
            be.getBusinessServices().getBusinessService().add(bs);
            sb.getBusinessEntity().add(be);
            BusinessDetail saveBusiness = publication.saveBusiness(sb);

            DeleteBusiness db = new DeleteBusiness();
            db.setAuthInfo(authInfoJoe);
            db.getBusinessKey().add(saveBusiness.getBusinessEntity().get(0).getBusinessKey());
            publication.deleteBusiness(db);
            Assert.fail("request should have been rejected");

        } catch (ValueNotAllowedException ex) {
            HandleException(ex);
View Full Code Here

TOP

Related Classes of org.apache.ws.scout.model.uddi.v2.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.