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

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


    }

    private static Name getFirstName(InternationalString iname) throws JAXRException {
        for (Object o : iname.getLocalizedStrings()) {
            LocalizedString locName = (LocalizedString) o;
            Name name = objectFactory.createName();
            name.setValue(locName.getValue());
            name.setLang(locName.getLocale().getLanguage());
            return name;
        }
        return null;
    }
View Full Code Here


        return null;
    }
    private static void addNames(List<Name> names, InternationalString iname) throws JAXRException {
        for (Object o : iname.getLocalizedStrings()) {
            LocalizedString locName = (LocalizedString) o;
            Name name = objectFactory.createName();
            name.setValue(locName.getValue());
            name.setLang(locName.getLocale().getLanguage());
            names.add(name);
        }
    }
View Full Code Here

                                    Description description = objectFactory.createDescription();
                                    ids.getDescription().add(description);
                                    description.setValue(link.getDescription().getValue());
                                }
                                if (link.getExternalURI()!=null) {
                                    OverviewDoc overviewDoc = objectFactory.createOverviewDoc();
                                    ids.setOverviewDoc(overviewDoc);
                                    overviewDoc.setOverviewURL(link.getExternalURI());
                                }
                            }
                        }
          }
              }
View Full Code Here

    }
   
    private static OverviewDoc getOverviewDocFromExternalLink(ExternalLink link)
       throws JAXRException
       {
           OverviewDoc od = objectFactory.createOverviewDoc();
           String url = link.getExternalURI();
           if(url != null)
               od.setOverviewURL(url);
           InternationalString extDesc = link.getDescription();
           if(extDesc != null) {
               Description description = objectFactory.createDescription();
               od.getDescription().add(description);
               description.setValue(extDesc.getValue());
           }
           return od;
       }
View Full Code Here

            Iterator it = ph.iterator();
      int phonearrPos = 0;
      while (it.hasNext()) {
                TelephoneNumber t = (TelephoneNumber) it.next();
        Phone phone = objectFactory.createPhone();
                String str = t.getNumber();
                log.debug("Telephone=" + str);
       
        // FIXME: If phone number is null, should the phone
        // not be set at all, or set to empty string?
        if (str != null) {
          phone.setValue(str);
        } else {
          phone.setValue("");
        }

        phonearr[phonearrPos] = phone;
        phonearrPos++;
            }
View Full Code Here

        return bt;
    }

  public static PublisherAssertion getPubAssertionFromJAXRAssociation(
      Association association) throws JAXRException {
    PublisherAssertion pa = objectFactory.createPublisherAssertion();
    try {
      if (association.getSourceObject().getKey() != null &&
        association.getSourceObject().getKey().getId() != null) {
            pa.setFromKey(association.getSourceObject().getKey().getId());
      }
     
      if (association.getTargetObject().getKey() != null &&
        association.getTargetObject().getKey().getId() != null) {
            pa.setToKey(association.getTargetObject().getKey().getId());
      }
            Concept c = association.getAssociationType();
            String v = c.getValue();
      KeyedReference kr = objectFactory.createKeyedReference();
            Key key = c.getKey();
      if (key == null) {
        // TODO:Need to check this. If the concept is a predefined
        // enumeration, the key can be the parent classification scheme
                key = c.getClassificationScheme().getKey();
            }
      if (key != null && key.getId() != null) {
        kr.setTModelKey(key.getId());
      }
            kr.setKeyName("Concept");

      if (v != null) {
        kr.setKeyValue(v);
      }

            pa.setKeyedReference(kr);
    } catch (Exception ud) {
            throw new JAXRException("Apache JAXR Impl:", ud);
        }
        return pa;
    }
View Full Code Here

    if (authInfo != null) {
      request.setAuthInfo(authInfo);
    }

        PublisherAssertions pa;
        JAXBElement<?> o = execute(this.objectFactory.createGetPublisherAssertions(request),
            this.getPublishURI());
        pa = (PublisherAssertions) o.getValue();

        return pa;
View Full Code Here

    if (assertionArray != null) {
      request.getPublisherAssertion().addAll(Arrays.asList(assertionArray));
    }

        PublisherAssertions pa;
        JAXBElement<?> o = execute(this.objectFactory.createSetPublisherAssertions(request),
            this.getPublishURI());
        pa = (PublisherAssertions) o.getValue();

        return pa;
View Full Code Here

        IRegistry registry = (IRegistry) registryService.getRegistry();
        try
        {
            ConnectionImpl con = ((RegistryServiceImpl)getRegistryService()).getConnection();
            AuthToken auth = this.getAuthToken(con,registry);
            PublisherAssertions result = null;
            try {
                    result = registry.getPublisherAssertions(auth.getAuthInfo());
          } catch (RegistryException rve) {
            String username = getUsernameFromCredentials(con.getCredentials());
            if (AuthTokenSingleton.getToken(username) != null) {
              AuthTokenSingleton.deleteAuthToken(username);
            }
            auth = getAuthToken(con, registry);
                result = registry.getPublisherAssertions(auth.getAuthInfo());
          }

            List<PublisherAssertion> publisherAssertionList = result.getPublisherAssertion();
            LinkedHashSet<Association> col = new LinkedHashSet<Association>();
            for (PublisherAssertion pas : publisherAssertionList) {
                String sourceKey = pas.getFromKey();
                String targetKey = pas.getToKey();
       
View Full Code Here

                PublisherAssertion pa = ScoutJaxrUddiHelper.getPubAssertionFromJAXRAssociation(association);
                sarr[currLoc] = pa;
                currLoc++;
           
                // Save PublisherAssertion
                PublisherAssertions bd = null;
                try {
                    bd = (PublisherAssertions) executeOperation(sarr, "SAVE_ASSOCIATION");
                }
                catch (RegistryException e) {
                    exceptions.add(new SaveException(e));
                    bulk.setExceptions(exceptions);
                    bulk.setStatus(JAXRResponse.STATUS_FAILURE);
                    return bulk;
                }
                if(bd != null)
                {
                  List<PublisherAssertion> publisherAssertionList = bd.getPublisherAssertion();
                  PublisherAssertion[] keyarr = new PublisherAssertion[publisherAssertionList.size()];
                  publisherAssertionList.toArray(keyarr);
                 
                  for (int i = 0; keyarr != null && i < keyarr.length; i++) {
                    PublisherAssertion result = (PublisherAssertion) keyarr[i];
View Full Code Here

TOP

Related Classes of org.apache.ws.scout.model.uddi.v2.PublisherAssertions

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.