Package javax.xml.registry.infomodel

Examples of javax.xml.registry.infomodel.Association


    public void setAssociations(Collection collection)
    {
        Set newAssociations = new HashSet(collection.size());
        for (Iterator i = collection.iterator(); i.hasNext();)
        {
            Association association = (Association) i.next();
            newAssociations.add(association);
        }
        associations = newAssociations;
    }
View Full Code Here


            throw new InvalidRequestException("Unknown interface: " + interfaceName);
        }
    }

    public Association createAssociation(RegistryObject targetObject, Concept associationType) throws JAXRException {
        Association assoc = (Association) this.createObject(LifeCycleManager.ASSOCIATION);
        assoc.setTargetObject(targetObject);
        assoc.setAssociationType(associationType);
        return assoc;
    }
View Full Code Here

*/
public class LifeCycleManagerTest extends TestCase {
    private LifeCycleManager manager;

    public void testCreateObjectAssociation() throws JAXRException {
        Association assoc = (Association) manager.createObject(LifeCycleManager.ASSOCIATION);
        assertEquals(AssociationImpl.class, assoc.getClass());
        assertSame(manager, assoc.getLifeCycleManager());
    }
View Full Code Here

{
  public static Association getAssociation(Collection orgs,
      LifeCycleManager lcm)
  throws JAXRException
  {
    Association asso = new AssociationImpl(lcm);
    Object[] arr = orgs.toArray();
    asso.setSourceObject((RegistryObject)arr[0]);
    asso.setTargetObject((RegistryObject)arr[1]);
    return asso;
  }
View Full Code Here

                && (targetObjectId==null || targetObjectId.equals(targetKey))) {
                  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);
                  col.add(asso);
                }
            }
            return new BulkResponseImpl(col);
        } catch (RegistryException e)
View Full Code Here

                String targetKey = asi.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());
                //Set Confirmation
                ((AssociationImpl)asso).setConfirmedBySourceOwner(caller);
                ((AssociationImpl)asso).setConfirmedByTargetOwner(other);

                if(confirm != Constants.COMPLETION_STATUS_COMPLETE)
                     ((AssociationImpl)asso).setConfirmed(false);

                Concept c = new ConceptImpl(getRegistryService().getBusinessLifeCycleManager());
                KeyedReference keyr = asi.getKeyedReference();
                c.setKey(new KeyImpl(keyr.getTModelKey()));
                c.setName(new InternationalStringImpl(keyr.getKeyName()));
                c.setValue(keyr.getKeyValue());
                asso.setKey(new KeyImpl(keyr.getTModelKey())); //TODO:Validate this
                asso.setAssociationType(c);
                col.add(asso);
            }


            return new BulkResponseImpl(col);
View Full Code Here

        Iterator iter = associations.iterator();
        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)
                {
                  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];
                        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);
                        coll.add(association.getKey());
                   }
                }
        }
        bulk.setCollection(coll);
        bulk.setExceptions(exceptions);
View Full Code Here

            throw new InvalidRequestException("Unknown interface: " + interfaceName);
        }
    }

    public Association createAssociation(RegistryObject targetObject, Concept associationType) throws JAXRException {
        Association assoc = (Association) this.createObject(LifeCycleManager.ASSOCIATION);
        assoc.setTargetObject(targetObject);
        assoc.setAssociationType(associationType);
        return assoc;
    }
View Full Code Here

TOP

Related Classes of javax.xml.registry.infomodel.Association

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.