Package org.apache.ws.scout.uddi

Examples of org.apache.ws.scout.uddi.PublisherAssertion


                len = a.length;
                col = new LinkedHashSet<Association>();
            }
            for (int i = 0; i < len; i++)
            {
                PublisherAssertion pas = a[i];
                String sourceKey = pas.getFromKey();
                String targetKey = pas.getToKey();
                Collection<Key> orgcol = new ArrayList<Key>();
                orgcol.add(new KeyImpl(sourceKey));
                orgcol.add(new KeyImpl(targetKey));
                BulkResponse bl = getRegistryObjects(orgcol, LifeCycleManager.ORGANIZATION);
                Association asso = ScoutUddiJaxrHelper.getAssociation(bl.getCollection(),
                                             registryService.getBusinessLifeCycleManager());
                KeyedReference keyr = pas.getKeyedReference();
                Concept c = new ConceptImpl(getRegistryService().getBusinessLifeCycleManager());
                c.setName(new InternationalStringImpl(keyr.getKeyName()));
                c.setKey( new KeyImpl(keyr.getTModelKey()) );
                c.setValue(keyr.getKeyValue());
                asso.setAssociationType(c);
View Full Code Here


        int currLoc = 0;
        while (iter.hasNext()) {
           
                Association association = (Association) iter.next();
                association.getSourceObject();
                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)
                {
                  PublisherAssertion[] keyarr = bd.getPublisherAssertionArray();
                  for (int i = 0; keyarr != null && i < keyarr.length; i++) {
                    PublisherAssertion result = (PublisherAssertion) keyarr[i];
                        KeyedReference keyr = result.getKeyedReference();
                        Concept c = new ConceptImpl(getRegistryService().getBusinessLifeCycleManager());
                        c.setName(new InternationalStringImpl(keyr.getKeyName()));
                        c.setKey( new KeyImpl(keyr.getTModelKey()) );
                        c.setValue(keyr.getKeyValue());
                        association.setAssociationType(c);
View Full Code Here

    private PublisherAssertion getPublisherAssertion(AssertionStatusItem asi)
    {
        String sourceKey = asi.getFromKey();
        String targetKey = asi.getToKey();
        PublisherAssertion pa = PublisherAssertion.Factory.newInstance();
       
        if (sourceKey != null) {
        pa.setFromKey(sourceKey);
        }
       
        if (targetKey != null) {
        pa.setToKey(targetKey);
        }
       
        KeyedReference keyr = asi.getKeyedReference();
       
        if (keyr != null) {
        pa.setKeyedReference(keyr);
        }
        //pa.setTModelKey(keyr.getTModelKey());
        //pa.setKeyName(keyr.getKeyName());
        //pa.setKeyValue(keyr.getKeyValue()); // -CBC- These are redundant?
        return pa;
View Full Code Here

        return bt;
    }

  public static PublisherAssertion getPubAssertionFromJAXRAssociation(
      Association assc) throws JAXRException {
    PublisherAssertion pa = PublisherAssertion.Factory.newInstance();
    try {
      if (assc.getSourceObject().getKey() != null &&
        assc.getSourceObject().getKey().getId() != null) {
            pa.setFromKey(assc.getSourceObject().getKey().getId());
      }
     
      if (assc.getTargetObject().getKey() != null &&
        assc.getTargetObject().getKey().getId() != null) {
            pa.setToKey(assc.getTargetObject().getKey().getId());
      }
            Concept c = assc.getAssociationType();
            String v = c.getValue();
      KeyedReference kr = KeyedReference.Factory.newInstance();
            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) {
        // The parent classification scheme may not always contain the
        // key. It is okay if it doesn't, since the UDDI v2 spec allows
        // TModelKey to be absent.

        // TODO: This setting to "" should not be needed at all.
        // However, a bug in jUDDI needs it to be there. See:
        // http://issues.apache.org/jira/browse/JUDDI-78
        //kr.setTModelKey("");
      } else {
                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

        return pa;
    }

  public static PublisherAssertion getPubAssertionFromJAXRAssociationKey(
      String key) throws JAXRException {
    PublisherAssertion pa = PublisherAssertion.Factory.newInstance();
    try {
      StringTokenizer token = new StringTokenizer(key, ":");
      if (token.hasMoreTokens()) {
               pa.setFromKey(getToken(token.nextToken()));
               pa.setToKey(getToken(token.nextToken()));
        KeyedReference kr = KeyedReference.Factory.newInstance();
        // Sometimes the Key is UUID:something
               String str = getToken(token.nextToken());
        if ("UUID".equals(str))
          str += ":" + getToken(token.nextToken());
               kr.setTModelKey(str);
               kr.setKeyName(getToken(token.nextToken()));
               kr.setKeyValue(getToken(token.nextToken()));
               pa.setKeyedReference(kr);
            }

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

TOP

Related Classes of org.apache.ws.scout.uddi.PublisherAssertion

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.