Package org.uddi.api_v3

Examples of org.uddi.api_v3.BusinessService


        log.info("The bindingDetail is truncated, the maxEntries must have been hit. The number of bindings is " + bindingDetail.getBindingTemplate().size());
      }
      for (BindingTemplate bindingTemplate : bindingDetail.getBindingTemplate()) {
        try {
          //check if the service exist
          BusinessService existingToService = uddiToClerk.findService(bindingTemplate.getServiceKey(), toClerk.getNode());
          if (existingToService!=null) {
            log.debug("Found service with key " +  existingToService.getServiceKey() + ". No need to add it again");
          } else {
            BusinessService fromService = uddiFromClerk.findService(bindingTemplate.getServiceKey(), fromClerk.getNode());
            fromService.getBusinessKey();
            //check if the business exist
            BusinessEntity existingBusinessEntity = uddiToClerk.findBusiness(fromService.getBusinessKey(), toClerk.getNode());
            if (existingBusinessEntity!=null) {
              log.debug("Found business with key " +  existingBusinessEntity.getBusinessKey() + ". No need to add it again");
            } else {
              log.info("Business was not found in the destination UDDI " + toClerk.getNode().getName()
                  + ", going to add it in.");
              new XRegistration(fromService.getBusinessKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterBusiness();
            }
            log.info("Service was not found in the destination UDDI " + toClerk.getNode().getName()
                + ", going to add it in.");
            new XRegistration(fromService.getServiceKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterService();
          }
          //now the service exists in the toNode and we can add this binding
          new XRegistration(bindingTemplate.getBindingKey(), new UDDIClerk(fromClerk), new UDDIClerk(toClerk)).xRegisterServiceBinding();
        } catch (Exception e) {
          log.error(e.getMessage(),e)
View Full Code Here


    
     @Test
     public void testReadingServiceAnnotation() {
       try {
         AnnotationProcessor ap = new AnnotationProcessor();
         BusinessService service = ap.readServiceAnnotations(HelloWorldMockup.class.getName(),null);
         assertNotNull(service);
         assertEquals("HelloWorld",service.getName().get(0).getValue());
         assertEquals(1,service.getBindingTemplates().getBindingTemplate().size());
         assertNull(service.getCategoryBag());
       } catch (Exception e) {
         //we should not have any issues reading the annotations
           e.printStackTrace();
           Assert.fail();
       }
View Full Code Here

       try {
         AnnotationProcessor ap = new AnnotationProcessor();
         Properties properties = new Properties();
         properties.put("serverName", "localhost");
         properties.put("serverPort", "8080");
         BusinessService service = ap.readServiceAnnotations(HelloWorldMockup2.class.getName(),properties);
         assertNotNull(service);
         assertEquals("HelloWorldMockup2",service.getName().get(0).getValue());
         assertEquals(1,service.getBindingTemplates().getBindingTemplate().size());
         BindingTemplate binding = service.getBindingTemplates().getBindingTemplate().get(0);
         String endPoint = binding.getAccessPoint().getValue();
         assertEquals("http://localhost:8080/subscription-listener/helloworld",endPoint);
         String serviceKey = binding.getServiceKey();
         assertEquals(service.getServiceKey(),serviceKey);
         assertNull(service.getCategoryBag());
       } catch (Exception e) {
         //we should not have any issues reading the annotations
           e.printStackTrace();
           Assert.fail();
       }
View Full Code Here

  }
 
  private Topology lookupEndpointInUDDI(String serviceKey) throws RemoteException, ConfigurationException, TransportException {
    Topology topology = null;
   
    BusinessService service = clerk.getServiceDetail(serviceKey);
    if (service==null) {
      log.warn("No Service with key " + serviceKey + " was found in the registry.");
      //TODO find service by tModel
    }
    if (service!=null && service.getBindingTemplates()!=null && service.getBindingTemplates().getBindingTemplate() != null) {
      ArrayList<String> eprs = new ArrayList<String>();
      BindingTemplates bindingTemplates = service.getBindingTemplates();
      if (bindingTemplates==null) {
        log.warn("Found service " + service.getName().get(0).getValue()
              + " with serviceKey '" + serviceKey + "'"
              + " but no EPRs");
      } else {
        log.debug("Found service " + service.getName().get(0).getValue()
              + " with serviceKey '" + serviceKey + "'"
              + " and " + bindingTemplates.getBindingTemplate().size() + " EPRs");
        //Loop over all bindingTemplates found and get the endpoints.
        for (BindingTemplate bindingTemplate : bindingTemplates.getBindingTemplate()) {
          AccessPoint accessPoint = bindingTemplate.getAccessPoint();
View Full Code Here

      List<ServiceInfo> siList = sInfos.getServiceInfo();
      if (siList == null || siList.size() == 0)
        Assert.fail("No result from getSubscriptionResults operation");
      ServiceInfo siOut = siList.get(0);
     
      BusinessService bsIn = (BusinessService)EntityCreator.buildFromDoc(TckBusinessService.JOE_SERVICE_XML, "org.uddi.api_v3");

      assertEquals(bsIn.getServiceKey(), siOut.getServiceKey());
     
      TckValidator.checkNames(bsIn.getName(), siOut.getName());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown");   
    }
View Full Code Here

        Iterator iter = services.iterator();
        int currLoc = 0;
        while (iter.hasNext()) {
            try {
                BusinessService bs = ScoutJaxrUddiV3Helper.getBusinessServiceFromJAXRService((Service) iter.next());
                sarr[currLoc] = bs;
                currLoc++;
            }
            catch (ClassCastException ce) {
                throw new UnexpectedObjectException();
            }
        }
        // Save Service
        ServiceDetail sd = null;
        try {
            sd = (ServiceDetail) executeOperation(sarr, "SAVE_SERVICE");
        }
        catch (RegistryV3Exception e) {
            exceptions.add(new SaveException(e.getLocalizedMessage()));
            bulk.setStatus(JAXRResponse.STATUS_FAILURE);
            return bulk;
        }

        List<BusinessService> bizServiceList = sd.getBusinessService();
        sarr = new BusinessService[bizServiceList.size()];
        bizServiceList.toArray(sarr);
       
        for (int i = 0; sarr != null && i < sarr.length; i++) {
            BusinessService entity = (BusinessService) sarr[i];
            coll.add(new KeyImpl(entity.getServiceKey()));
        }
        bulk.setCollection(coll);
        bulk.setExceptions(exceptions);

        return bulk;
View Full Code Here

                clerk.unRegisterBinding(bindingTemplate.getBindingKey(), clerk.getUDDINode().getApiNode());
              }
            }
            if (removeServiceWithNoBindingTemplates) {
              try {
                BusinessService existingService = clerk.findService(businessService.getServiceKey(), clerk.getUDDINode().getApiNode());
                if (existingService.getBindingTemplates()==null || existingService.getBindingTemplates().getBindingTemplate().size()==0) {
                  clerk.unRegisterService(businessService.getServiceKey(),clerk.getUDDINode().getApiNode());
                }
              } catch (Exception e) {
                log.error(e.getMessage(),e);
              }
View Full Code Here

      List<ServiceInfo> siList = sInfos.getServiceInfo();
      if (siList == null || siList.size() == 0)
        Assert.fail("No result from getSubscriptionResults operation");
      ServiceInfo siOut = siList.get(0);
     
      BusinessService bsIn = (BusinessService)EntityCreator.buildFromDoc(TckBusinessService.JOE_SERVICE_XML, "org.uddi.api_v3");

      assertEquals(bsIn.getServiceKey(), siOut.getServiceKey());
     
      TckValidator.checkNames(bsIn.getName(), siOut.getName());
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown");   
    }
View Full Code Here

          serviceLocator = serviceLocators.get(clerk.getName());
        }
      }
      if (RegistrationType.WSDL.equals(registrationInfo.getRegistrationType())) {
        WSDL2UDDI wsdl2UDDI = new WSDL2UDDI(clerk, urlLocalizer, properties);
        BusinessService service = wsdl2UDDI.registerBusinessService(registrationInfo.getServiceQName(),
                   registrationInfo.getPortName(),
                   registrationInfo.getServiceUrl(),
                   registrationInfo.getWsdlDefinition()).getBusinessService();
        serviceLocator.addService(service.getServiceKey());
       
      } else if (RegistrationType.BPEL.equals(registrationInfo.getRegistrationType())) {
        BPEL2UDDI bpel2UDDI = new BPEL2UDDI(clerk, urlLocalizer, properties);
        BindingTemplate binding = bpel2UDDI.register(registrationInfo.getServiceQName(),
                   registrationInfo.getPortName(),
View Full Code Here

      List<ServiceInfo> siList = sInfos.getServiceInfo();
      if (siList == null || siList.size() == 0)
        Assert.fail("No result from find service operation");
      ServiceInfo siOut = siList.get(0);
     
      BusinessService bsIn = (BusinessService)EntityCreator.buildFromDoc(TckBusinessService.JOE_SERVICE_XML, "org.uddi.api_v3");
     
      assertEquals(bsIn.getServiceKey(), siOut.getServiceKey());
     
      TckValidator.checkNames(bsIn.getName(), siOut.getName());
      serviceKey = siOut.getServiceKey();
    }
    catch(Exception e) {
      logger.error(e.getMessage(), e);
      Assert.fail("No exception should be thrown.");
View Full Code Here

TOP

Related Classes of org.uddi.api_v3.BusinessService

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.