Package org.uddi.api_v2

Examples of org.uddi.api_v2.BusinessServices


    }

    public static BusinessEntity getBusinessEntityFromJAXROrg(Organization organization)
      throws JAXRException {
    BusinessEntity biz = objectFactory.createBusinessEntity();
    BusinessServices bss = objectFactory.createBusinessServices();
    BusinessService[] barr = new BusinessService[0];

    try {
      // It may just be an update
            Key key = organization.getKey();
      if (key != null && key.getId() != null) {
        biz.setBusinessKey(key.getId());
            } else {
                biz.setBusinessKey("");
            }
      // Lets get the Organization attributes at the top level
     
      InternationalString iname = organization.getName();
     
      if (iname != null) {
                addNames(biz.getName(), iname);
      }
     
      InternationalString idesc = organization.getDescription();
     
            addDescriptions(biz.getDescription(), idesc);

      if (organization.getPrimaryContact() != null &&
        organization.getPrimaryContact().getPersonName()!= null &&
        organization.getPrimaryContact().getPersonName().getFullName() != null) {

        biz.setAuthorizedName(organization.getPrimaryContact().getPersonName()
            .getFullName());
      }

            Collection<Service> s = organization.getServices();
            log.debug("?Org has services=" + s.isEmpty());

      barr = new BusinessService[s.size()];

            Iterator<Service> iter = s.iterator();
      int barrPos = 0;
      while (iter.hasNext()) {
        BusinessService bs = ScoutJaxrUddiHelper
            .getBusinessServiceFromJAXRService((Service) iter
                .next());
        barr[barrPos] = bs;
        barrPos++;
            }

            /*
             * map users : JAXR has concept of 'primary contact', which is a
             * special designation for one of the users, and D6.1 seems to say
             * that the first UDDI user is the primary contact
             */

      Contacts cts = objectFactory.createContacts();
      Contact[] carr = new Contact[0];

            User primaryContact = organization.getPrimaryContact();
            Collection<User> users = organization.getUsers();

            // Expand array to necessary size only (xmlbeans does not like
            // null items in cases like this)

            int carrSize = 0;

            if (primaryContact != null) {
                carrSize += 1;
            }

            // TODO: Clean this up and make it more efficient
            Iterator<User> it = users.iterator();
            while (it.hasNext()) {
                User u = (User) it.next();
                if (u != primaryContact) {
                    carrSize++;
                }
            }

            carr = new Contact[carrSize];

            /*
             * first do primary, and then filter that out in the loop
             */
            if (primaryContact != null) {
                Contact ct = getContactFromJAXRUser(primaryContact);
                carr[0] = ct;
            }

            it = users.iterator();
            int carrPos = 1;
            while (it.hasNext()) {
                User u = (User) it.next();

                if (u != primaryContact) {
                    Contact ct = getContactFromJAXRUser(u);
                    carr[carrPos] = ct;
                    carrPos++;
                }
            }

      bss.getBusinessService().addAll(Arrays.asList(barr));
            if (carr.length>0) {
                cts.getContact().addAll(Arrays.asList(carr));
                biz.setContacts(cts);
            }
            biz.setBusinessServices(bss);
View Full Code Here


      org.setDescription(is);
    }
    org.setKey(lifeCycleManager.createKey(businessEntity.getBusinessKey()));

    //Set Services also
    BusinessServices services = businessEntity.getBusinessServices();
    if(services != null)
    {
      List<BusinessService> bizServiceList = services.getBusinessService();
      for (BusinessService businessService : bizServiceList) {
        org.addService(getService(businessService, lifeCycleManager));
      }
    }
View Full Code Here

    }

    org.setKey(lifeCycleManager.createKey(entity.getBusinessKey()));

    //Set Services also
    BusinessServices services = entity.getBusinessServices();
    List<BusinessService> bizServiceList = services.getBusinessService();
    for (BusinessService businessService : bizServiceList) {
      org.addService(getService(businessService, lifeCycleManager));
    }

    /*
 
View Full Code Here

       
        private static AccessPoint MapAccessPoint(org.uddi.api_v3.AccessPoint accessPoint) {
                if (accessPoint == null) {
                        return null;
                }
                return new AccessPoint(accessPoint.getValue(), MapURLType(accessPoint.getValue()));
        }
View Full Code Here

       
        public static AddPublisherAssertions MapAddPublisherAssertions(org.uddi.api_v3.AddPublisherAssertions body) {
                if (body == null) {
                        return null;
                }
                AddPublisherAssertions r = new AddPublisherAssertions();
                r.setAuthInfo(body.getAuthInfo());
                r.setGeneric(VERSION);
               
                r.getPublisherAssertion().addAll(MapPublisherAssertion(body.getPublisherAssertion()));
                return r;
               
        }
View Full Code Here

                List<Address> r = new ArrayList<Address>();
                if (address == null) {
                        return r;
                }
                for (int i = 0; i < address.size(); i++) {
                        Address x = new Address();
                        x.setSortCode(address.get(i).getSortCode());
                        x.setTModelKey(address.get(i).getTModelKey());
                        x.setUseType(address.get(i).getUseType());
                        x.getAddressLine().addAll(MapAddressLine(address.get(i).getAddressLine()));
                        r.add(x);
                }
                return r;
        }
View Full Code Here

                List<AddressLine> r = new ArrayList<AddressLine>();
                if (addressLine == null) {
                        return r;
                }
                for (int i = 0; i < addressLine.size(); i++) {
                        AddressLine x = new AddressLine();
                        x.setKeyName(addressLine.get(i).getKeyName());
                        x.setKeyValue(addressLine.get(i).getKeyValue());
                        x.setValue(addressLine.get(i).getValue());
                        r.add(x);
                }
               
                return r;
        }
View Full Code Here

         */
        public static AssertionStatusReport MapAssertionStatusReport(List<AssertionStatusItem> assertionStatusReport) {
                if (assertionStatusReport == null) {
                        return null;
                }
                AssertionStatusReport r = new AssertionStatusReport();
                r.setGeneric(VERSION);
                for (int i = 0; i < assertionStatusReport.size(); i++) {
                        org.uddi.api_v2.AssertionStatusItem x = new org.uddi.api_v2.AssertionStatusItem();
                       
                        switch (assertionStatusReport.get(i).getCompletionStatus()) {
                                case STATUS_BOTH_INCOMPLETE:
                                        x.setCompletionStatus(null);
                                        break;
                                case STATUS_COMPLETE:
                                        x.setCompletionStatus("status:complete");
                                        break;
                                case STATUS_FROM_KEY_INCOMPLETE:
                                        x.setCompletionStatus("status:fromKey_incomplete");
                                        break;
                                case STATUS_TO_KEY_INCOMPLETE:
                                        x.setCompletionStatus("status:toKey_incomplete");
                                        break;
                        }
                        x.setFromKey(assertionStatusReport.get(i).getFromKey());
                        x.setToKey(assertionStatusReport.get(i).getToKey());
                        if (assertionStatusReport.get(i).getKeyedReference() != null) {
                                x.setKeyedReference(new KeyedReference(assertionStatusReport.get(i).getKeyedReference().getTModelKey(),
                                     assertionStatusReport.get(i).getKeyedReference().getKeyName(),
                                     assertionStatusReport.get(i).getKeyedReference().getKeyValue()));
                        }
                       
                        x.setKeysOwned(new KeysOwned());
                        r.getAssertionStatusItem().add(x);
                        // assertionStatusReport.get(i).
                }
               
                return r;
        }
View Full Code Here

   }

   @Override
   public List<AssertionStatusItem> getAssertionStatusReport(String authInfo, CompletionStatus completionStatus) throws DispositionReportFaultMessage, RemoteException {
      try {
         AssertionStatusReport assertionStatusReport = publishService.getAssertionStatusReport(MapUDDIv3Tov2.MapGetAssertionStatusReport(authInfo, completionStatus));
         return MapUDDIv2Tov3.MapAssertionStatusItems(assertionStatusReport);
      } catch (DispositionReport ex) {
         throw MapUDDIv2Tov3.MapException(ex);
      } catch (SOAPFaultException ex) {
         throw MapUDDIv2Tov3.MapException(ex);
View Full Code Here

                try {
                        org.uddi.api_v3.GetAuthToken r = new org.uddi.api_v3.GetAuthToken();
                        r.setCred(body.getCred());
                        r.setUserID(body.getUserID());
                        org.uddi.api_v3.AuthToken authToken = securityService.getAuthToken(r);
                        AuthToken ret = new AuthToken();
                        ret.setAuthInfo(authToken.getAuthInfo());
                        ret.setGeneric("2.0");
                        ret.setOperator(getNodeID());
                        return ret;
                } catch (DispositionReportFaultMessage ex) {
                        throw MapUDDIv3Tov2.MapException(ex, getNodeID());
                }
        }
View Full Code Here

TOP

Related Classes of org.uddi.api_v2.BusinessServices

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.