Package javax.xml.registry

Examples of javax.xml.registry.BulkResponse


            Collection<Concept> concepts = new ArrayList<Concept>();
            concepts.add(concept);

            Key key=null;
            BulkResponse br = blm.saveConcepts(concepts);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
            {
                System.out.println("Concept Saved");
                Collection coll = br.getCollection();
                Iterator iter = coll.iterator();
                while (iter.hasNext())
                {
                    key = (Key) iter.next();
                    System.out.println("Saved Key=" + key.getId());
                }//end while
            } else
            {
                System.err.println("JAXRExceptions " +
                        "occurred during save:");
                Collection exceptions = br.getExceptions();
                Iterator iter = exceptions.iterator();
                while (iter.hasNext())
                {
                    Exception e = (Exception) iter.next();
                    System.err.println(e.toString());
View Full Code Here


            Collection<String> findQualifiers = new ArrayList<String>();
            findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
            Collection<String> namePatterns = new ArrayList<String>();
            namePatterns.add("%" + CONCEPT_NAME + "%");

            BulkResponse br = bqm.findConcepts(findQualifiers, namePatterns, null, null, null);

//          check how many organisation we have matched
            Collection concepts = br.getCollection();

            if (concepts == null)
            {
                System.out.println("\n-- Matched 0 orgs");
View Full Code Here

      // All created ... now try to delete.
      String associationID = findAndDeleteAssociation();
     
      //Let us look for associations now
      BulkResponse associationResp =
        bqm.findCallerAssociations(null, Boolean.TRUE, Boolean.TRUE, null);
     
      if(associationResp.getExceptions() != null)
      {
        System.out.println(associationResp.getExceptions());
        fail("Association lookup failed");
      }
      else
      {
        Collection retAssocs = associationResp.getCollection();
                if (retAssocs.size() == 0)
                {
                    //Pass
                } else
                {
View Full Code Here

    sOrg.addAssociation(association);

    ArrayList<Association> associations = new ArrayList<Association>();
    associations.add(association);

    BulkResponse br = blm.saveAssociations(associations, true);
    if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
      System.out.println("Association Saved");
      Collection coll = br.getCollection();
      Iterator iter = coll.iterator();
      while (iter.hasNext()) {
        System.out.println("Saved Key=" + iter.next());
      }// end while
    } else {
      System.err.println("JAXRExceptions " + "occurred during save:");
      Collection exceptions = br.getExceptions();
      Iterator iter = exceptions.iterator();
      while (iter.hasNext()) {
        Exception e = (Exception) iter.next();
        System.err.println(e.toString());
      }
View Full Code Here

    Concept type = bqm.findConceptByPath(associationType);
    ArrayList<Concept> conceptTypes = new ArrayList<Concept>(1);
    conceptTypes.add(type);

    BulkResponse br = bqm.findAssociations(findQualifiers, sOrgID, tOrgID,
        conceptTypes);
    Collection associations = br.getCollection();

    if (associations == null) {
      System.out.println("\n-- Matched 0 orgs");
            fail("Expected 1 association");
View Full Code Here

    System.out.println("\nDeleting association with id " + id + "\n");

    Collection<Key> keys = new ArrayList<Key>();
    keys.add(key);
    BulkResponse response = blm.deleteAssociations(keys);

        assertEquals(BulkResponse.STATUS_SUCCESS, response.getStatus());
    Collection exceptions = response.getExceptions();
    if (exceptions == null) {
      Collection retKeys = response.getCollection();
      Iterator keyIter = retKeys.iterator();
      javax.xml.registry.infomodel.Key orgKey = null;
      if (keyIter.hasNext()) {
        orgKey = (javax.xml.registry.infomodel.Key) keyIter.next();
        id = orgKey.getId();
View Full Code Here

      namePatterns.add("%" + tempSrcOrgName + "%");
      namePatterns.add("%" + tempTgtOrgName + "%");
    }
    // Find based upon qualifier type and values
    System.out.println("\n-- searching the registry --\n");
    BulkResponse response = bqm.findOrganizations(findQualifiers,
        namePatterns, null, null, null, null);

    // check how many organisation we have matched
    Collection orgs = response.getCollection();
    if (orgs == null) {
      System.out.println("\n-- Matched 0 orgs");

    } else {
      System.out.println("\n-- Matched " + orgs.size()
View Full Code Here

          + sOrgKey + " and " + tOrgKey + "\n");

      Collection<Key> keys = new ArrayList<Key>();
      keys.add(sOrgKey);
      keys.add(tOrgKey);
      BulkResponse response = blm.deleteOrganizations(keys);

      Collection exceptions = response.getExceptions();
      if (exceptions == null) {
        Collection retKeys = response.getCollection();
        Iterator keyIter = retKeys.iterator();
        Key orgKey = null;
        while (keyIter.hasNext()) {
          orgKey = (javax.xml.registry.infomodel.Key) keyIter.next();
          String id = orgKey.getId();
View Full Code Here

            Collection<Organization> orgs = new ArrayList<Organization>();
            Organization organization = creator.createOrganization(this.getClass().getName());
            orgs.add(organization);

            //save the Organization
            BulkResponse br = blm.saveOrganizations(orgs);
            assertEquals(JAXRResponse.STATUS_SUCCESS, br.getStatus());
            orgKeys = (Collection<Key>) br.getCollection();
        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
       
        try {
            RegistryService rs = connection.getRegistryService();
            blm = rs.getBusinessLifeCycleManager();
            BulkResponse br = blm.deleteOrganizations(orgKeys);
            assertEquals(JAXRResponse.STATUS_SUCCESS, br.getStatus());
        } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        }
    }
View Full Code Here

            ClassificationScheme cScheme = blm.createClassificationScheme("testScheme -- APACHE SCOUT TEST", "Sample Classification Scheme");

            ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
            cSchemes.add(cScheme);
            //save
            BulkResponse br = blm.saveClassificationSchemes(cSchemes);
            assertEquals(BulkResponse.STATUS_SUCCESS, br.getStatus());
            //remove
            BulkResponse br2 = blm.deleteClassificationSchemes((Collection<Key>)br.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
        } catch (JAXRException je) {
            fail(je.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of javax.xml.registry.BulkResponse

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.