Package org.uddi.api_v2

Examples of org.uddi.api_v2.GetServiceDetail


        }
    }

    private void PrintServiceDetailsByBusiness(BusinessInfos businessInfos, String token) throws Exception {
        for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) {
            GetServiceDetail gsd = new GetServiceDetail();
            for (int k = 0; k < businessInfos.getBusinessInfo().get(i).getServiceInfos().getServiceInfo().size(); k++) {
                gsd.getServiceKey().add(businessInfos.getBusinessInfo().get(i).getServiceInfos().getServiceInfo().get(k).getServiceKey());
            }
            gsd.setAuthInfo(token);
            System.out.println("Fetching data for business " + businessInfos.getBusinessInfo().get(i).getBusinessKey());
            ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);
            for (int k = 0; k < serviceDetail.getBusinessService().size(); k++) {
                PrintServiceDetail(serviceDetail.getBusinessService().get(k));
            }
View Full Code Here


    return findService(serviceKey, this.getUDDINode().getApiNode());
  }
 
  public BusinessService findService(String serviceKey, Node node) throws RemoteException,
  TransportException, ConfigurationException  {
    GetServiceDetail getServiceDetail = new GetServiceDetail();
    getServiceDetail.getServiceKey().add(serviceKey);
    getServiceDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
    try {
      ServiceDetail sd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getServiceDetail(getServiceDetail);
      List<BusinessService> businessServiceList = sd.getBusinessService();
      if (businessServiceList.size() == 0) throw new ConfigurationException("Could not find Service with key=" + serviceKey);
      return businessServiceList.get(0);
View Full Code Here

         * @throws TransportException
         * @throws ConfigurationException
         */
        public BusinessService getServiceDetail(String serviceKey, Node node) throws RemoteException,
                TransportException, ConfigurationException {
                GetServiceDetail getServiceDetail = new GetServiceDetail();
                getServiceDetail.getServiceKey().add(serviceKey);
                getServiceDetail.setAuthInfo(getAuthToken(node.getSecurityUrl()));
                try {
                        ServiceDetail sd = getUDDINode().getTransport().getUDDIInquiryService(node.getInquiryUrl()).getServiceDetail(getServiceDetail);
                        List<BusinessService> businessServiceList = sd.getBusinessService();
                        if (businessServiceList.size() == 0) {
                                throw new ConfigurationException("Could not find Service with key=" + serviceKey);
View Full Code Here

                        fb.getFindQualifiers().getFindQualifier().add(UDDIConstants.APPROXIMATE_MATCH);
                        ServiceList findService = inquiry.findService(fb);
                        int returnedcount = findService.getServiceInfos().getServiceInfo().size();
                        do {
                                for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) {
                                        GetServiceDetail gsd = new GetServiceDetail();
                                        gsd.getServiceKey().add(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey());
                                        ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);
                                        if (serviceDetail.getBusinessService().get(0).getBindingTemplates() != null
                                                && !serviceDetail.getBusinessService().get(0).getBindingTemplates().getBindingTemplate().isEmpty()) {
                                                return serviceDetail.getBusinessService().get(0).getBindingTemplates().getBindingTemplate().get(0);
                                        }
View Full Code Here

                }
                return false;
        }

        private static boolean CheckServiceAndParentForSignature(String serviceKey, UDDIInquiryPortType uddiInquiryService, String token) throws UnexpectedResponseException {
                GetServiceDetail gsd = new GetServiceDetail();
                gsd.setAuthInfo(token);
                gsd.getServiceKey().add(serviceKey);
                String bizkey = null;
                try {
                        ServiceDetail serviceDetail = uddiInquiryService.getServiceDetail(gsd);
                        if (serviceDetail != null) {
                                if (!serviceDetail.getBusinessService().isEmpty()) {
View Full Code Here

        public static GetServiceDetail MapGetServiceDetail(org.uddi.api_v2.GetServiceDetail body) {
                if (body == null) {
                        return null;
                }
                GetServiceDetail r = new GetServiceDetail();
                r.getServiceKey().addAll(body.getServiceKey());
                return r;
        }
View Full Code Here

        fs.getFindQualifiers().getFindQualifier().add(UDDIConstants.EXACT_MATCH);
        fs.getName().add(new Name("ZeroCool Service", lang));
        ServiceList findService = inquiry.findService(fs);

        //parse the results and get a list of services to get the details on
        GetServiceDetail gsd = new GetServiceDetail();
        for (int i = 0; i < findService.getServiceInfos().getServiceInfo().size(); i++) {
            gsd.getServiceKey().add(findService.getServiceInfos().getServiceInfo().get(i).getServiceKey());
        }
        ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);

        //parse the service details, looking for our versioned service
        if (serviceDetail != null) {
View Full Code Here

                }
        }

        private void PrintServiceDetailsByBusiness(BusinessInfos businessInfos, String token) throws Exception {
                for (int i = 0; i < businessInfos.getBusinessInfo().size(); i++) {
                        GetServiceDetail gsd = new GetServiceDetail();
                        for (int k = 0; k < businessInfos.getBusinessInfo().get(i).getServiceInfos().getServiceInfo().size(); k++) {
                                gsd.getServiceKey().add(businessInfos.getBusinessInfo().get(i).getServiceInfos().getServiceInfo().get(k).getServiceKey());
                        }
                        gsd.setAuthInfo(token);
                        System.out.println("Fetching data for business " + businessInfos.getBusinessInfo().get(i).getBusinessKey());
                        ServiceDetail serviceDetail = inquiry.getServiceDetail(gsd);
                        for (int k = 0; k < serviceDetail.getBusinessService().size(); k++) {
                                PrintServiceDetail(serviceDetail.getBusinessService().get(k));
                        }
View Full Code Here

        else
          result.setBusinessDetail(businessDetail);
       
      }
      if (subscriptionFilter.getGetServiceDetail() != null) {
        GetServiceDetail getDetail = subscriptionFilter.getGetServiceDetail();
 
        // Running through the key list here to determine the deleted keys and store the existing entities.
        KeyBag missingKeyBag = new KeyBag();
        missingKeyBag.setDeleted(true);
        List<org.apache.juddi.model.BusinessService> existingList = new ArrayList<org.apache.juddi.model.BusinessService>(0);
        for (String key : getDetail.getServiceKey()) {
          org.apache.juddi.model.BusinessService modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, key);
          if (modelBusinessService != null)
            existingList.add(modelBusinessService);
          else
            missingKeyBag.getBusinessKey().add(key);
        }
        // Store deleted keys in the results
        if (missingKeyBag.getServiceKey() != null && missingKeyBag.getServiceKey().size() > 0)
          result.getKeyBag().add(missingKeyBag);
 
        KeyBag resultsKeyBag = new KeyBag();
        ServiceDetail serviceDetail = new ServiceDetail();
       
        // 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.BusinessService modelBusinessService = existingList.get(currentIndex);
           
          if (startPointDate.after(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (endPointDate.before(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (modelSubscription.isBrief()) {
            resultsKeyBag.getServiceKey().add(modelBusinessService.getEntityKey());
          }
          else {
            org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
            MappingModelToApi.mapBusinessService(modelBusinessService, apiBusinessService);
            serviceDetail.getBusinessService().add(apiBusinessService);
           
            returnedRowCount++;
          }
 
          // If the returned rows equals the max allowed, we can end the loop.
          if (modelSubscription.getMaxEntities() != null) {
            if (returnedRowCount == modelSubscription.getMaxEntities())
              break;
          }
 
          currentIndex++;
        }
       
        // If the loop was broken prematurely (max row count hit) we set the chunk data to the next index to start with.
        // A non-null value of chunk data will cause a chunk token to be generated.
        if (currentIndex < (existingList.size() - 1))
          chunkData = currentIndex + 1;
        else
          chunkData = null;
       
        if (modelSubscription.isBrief())
          result.getKeyBag().add(resultsKeyBag);
        else
          result.setServiceDetail(serviceDetail);
       
      }
      if (subscriptionFilter.getGetTModelDetail() != null) {
        GetTModelDetail getDetail = subscriptionFilter.getGetTModelDetail();
 
        // Running through the key list here to determine the deleted keys and store the existing entities.
        KeyBag missingKeyBag = new KeyBag();
        missingKeyBag.setDeleted(true);
        List<org.apache.juddi.model.Tmodel> existingList = new ArrayList<org.apache.juddi.model.Tmodel>(0);
        for (String key : getDetail.getTModelKey()) {
          org.apache.juddi.model.Tmodel modelTModel = em.find(org.apache.juddi.model.Tmodel.class, key);
          if (modelTModel != null)
            existingList.add(modelTModel);
          else
            missingKeyBag.getTModelKey().add(key);
View Full Code Here

        else
          result.setBusinessDetail(businessDetail);
       
      }
      if (subscriptionFilter.getGetServiceDetail() != null) {
        GetServiceDetail getDetail = subscriptionFilter.getGetServiceDetail();
 
        // Running through the key list here to determine the deleted keys and store the existing entities.
        KeyBag missingKeyBag = new KeyBag();
        missingKeyBag.setDeleted(true);
        List<org.apache.juddi.model.BusinessService> existingList = new ArrayList<org.apache.juddi.model.BusinessService>(0);
        for (String key : getDetail.getServiceKey()) {
          org.apache.juddi.model.BusinessService modelBusinessService = em.find(org.apache.juddi.model.BusinessService.class, key);
          if (modelBusinessService != null)
            existingList.add(modelBusinessService);
          else
            missingKeyBag.getBusinessKey().add(key);
        }
        // Store deleted keys in the results
        if (missingKeyBag.getServiceKey() != null && missingKeyBag.getServiceKey().size() > 0)
          result.getKeyBag().add(missingKeyBag);
 
        KeyBag resultsKeyBag = new KeyBag();
        ServiceDetail serviceDetail = new ServiceDetail();
       
        // 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.BusinessService modelBusinessService = existingList.get(currentIndex);
           
          if (startPointDate.after(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (endPointDate.before(modelBusinessService.getModifiedIncludingChildren())) {
            currentIndex++;
            continue;
          }
         
          if (modelSubscription.isBrief()) {
            resultsKeyBag.getServiceKey().add(modelBusinessService.getEntityKey());
          }
          else {
            org.uddi.api_v3.BusinessService apiBusinessService = new org.uddi.api_v3.BusinessService();
            MappingModelToApi.mapBusinessService(modelBusinessService, apiBusinessService);
            serviceDetail.getBusinessService().add(apiBusinessService);
           
            returnedRowCount++;
          }
 
          // If the returned rows equals the max allowed, we can end the loop.
          if (modelSubscription.getMaxEntities() != null) {
            if (returnedRowCount == modelSubscription.getMaxEntities())
              break;
          }
 
          currentIndex++;
        }
       
        // If the loop was broken prematurely (max row count hit) we set the chunk data to the next index to start with.
        // A non-null value of chunk data will cause a chunk token to be generated.
        if (currentIndex < (existingList.size() - 1))
          chunkData = currentIndex + 1;
        else
          chunkData = null;
       
        if (modelSubscription.isBrief())
          result.getKeyBag().add(resultsKeyBag);
        else
          result.setServiceDetail(serviceDetail);
       
      }
      if (subscriptionFilter.getGetTModelDetail() != null) {
        GetTModelDetail getDetail = subscriptionFilter.getGetTModelDetail();
 
        // Running through the key list here to determine the deleted keys and store the existing entities.
        KeyBag missingKeyBag = new KeyBag();
        missingKeyBag.setDeleted(true);
        List<org.apache.juddi.model.Tmodel> existingList = new ArrayList<org.apache.juddi.model.Tmodel>(0);
        for (String key : getDetail.getTModelKey()) {
          org.apache.juddi.model.Tmodel modelTModel = em.find(org.apache.juddi.model.Tmodel.class, key);
          if (modelTModel != null)
            existingList.add(modelTModel);
          else
            missingKeyBag.getTModelKey().add(key);
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.GetServiceDetail

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.