Examples of BulkResponse


Examples of javax.xml.registry.BulkResponse

      findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
      findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
      ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, JBOSS_ESB_CATEGORY);
      // If the scheme returned null, then we have to create a org.jboss.soa.esb.:category scheme to use
      if (cScheme == null) {
        BulkResponse br = null;
        try {
          ClassificationScheme scheme = blm.createClassificationScheme(JBOSS_ESB_CATEGORY, JBOSS_ESB_CATEGORY);
          ArrayList<ClassificationScheme> cSchemes = new ArrayList<ClassificationScheme>();
          cSchemes.add(scheme);
          br = blm.saveClassificationSchemes(cSchemes);
         
          if (br!=null && br.getStatus() != JAXRResponse.STATUS_SUCCESS) {
            throw new JAXRException("Tried to saveClassificationsSchemes, got result "
                + br.getStatus());
          }

        } catch (Exception e) {
          throw new JAXRException(e);
        }
View Full Code Here

Examples of javax.xml.registry.BulkResponse

      ArrayList<SpecificationLink> specs = new ArrayList<SpecificationLink>();
            SpecificationLink sl = new SpecificationLinkImpl(blm);
            sl.setSpecificationObject(jbossTModel);

      specs.add(sl);
      BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),findQualifiers,null,specs);
      if (bulkResponse.getStatus()==JAXRResponse.STATUS_SUCCESS){
        serviceBindings = (Collection<ServiceBinding>)bulkResponse.getCollection();
        for (Iterator bindIter = serviceBindings.iterator(); bindIter.hasNext();)
        {
          ServiceBinding binding = (ServiceBinding) bindIter.next();
          Collection<SpecificationLink> bindingSpecs = binding.getSpecificationLinks();         
                SpecificationLink slink = new SpecificationLinkImpl(blm);
View Full Code Here

Examples of javax.xml.registry.BulkResponse

        assertNotNull("Org Key is null?", orgkey);
        if (blm == null) blm = this.getBusinessLifeCycleManager();
        Collection keys = new ArrayList();
        keys.add(orgkey);

        BulkResponse response = blm.deleteOrganizations(keys);
        Collection exceptions = response.getExceptions();
        assertNull("Deleting Org with Key=" + orgkey, exceptions);
    }
View Full Code Here

Examples of javax.xml.registry.BulkResponse

            blm = rs.getBusinessLifeCycleManager();
            Collection orgs = new ArrayList();
            Organization org = createOrganization("JBOSS");

            orgs.add(org);
            BulkResponse br = blm.saveOrganizations(orgs);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
            {
                if ("true".equalsIgnoreCase(debugProp))
                    System.out.println("Organization Saved");
                Collection coll = br.getCollection();
                Iterator iter = coll.iterator();
                while (iter.hasNext())
                {
                    Key key = (Key) iter.next();
                    keyid = key.getId();
                    if ("true".equalsIgnoreCase(debugProp))
                        System.out.println("Saved Key=" + key.getId());
                    assertNotNull(keyid);
                }//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

Examples of javax.xml.registry.BulkResponse

            getJAXREssentials();
            String orgname = "Jaxr Org";
            Organization org = blm.createOrganization(getIString(orgname));
            Collection orgs = new ArrayList();
            orgs.add(org);
            BulkResponse br = blm.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail("Save Organizations failed ");
            }
            orgKeys = br.getCollection();
            Iterator iter = orgKeys.iterator();
            while (iter.hasNext())
            {
                orgKey = (Key) iter.next();
            }


            org = (Organization) bqm.getRegistryObject(orgKey.getId(), LifeCycleManager.ORGANIZATION);

            Service service = blm.createService(serviceName);
            org.addService(service);
            Collection services = new ArrayList();
            services.add(service);
            br = blm.saveServices(services);
            if (br.getExceptions() != null)
            {
                fail("Save Services failed ");
            }
            serviceKeys = br.getCollection();
            iter = serviceKeys.iterator();
            while (iter.hasNext())
            {
                serviceKey = (Key) iter.next();
            }

            service = (Service) bqm.getRegistryObject(serviceKey.getId(), LifeCycleManager.SERVICE);

            //Save some concepts
            Concept testConcept = (Concept) blm.createObject(LifeCycleManager.CONCEPT);
            testConcept.setName(blm.createInternationalString(conceptName));
            Collection concepts = new ArrayList();
            concepts.add(testConcept);
            br = blm.saveConcepts(concepts);
            if (br.getExceptions() != null)
            {
                fail("Save Concepts failed ");
            }
            conceptKeys = br.getCollection();
            iter = conceptKeys.iterator();
            while (iter.hasNext())
            {
                conceptKey = (Key) iter.next();
            }

            testConcept = (Concept) bqm.getRegistryObject(conceptKey.getId(), LifeCycleManager.CONCEPT);
            SpecificationLink sl = blm.createSpecificationLink();
            sl.setSpecificationObject(testConcept);
            ServiceBinding sb = blm.createServiceBinding();
            sb.setDescription(blm.createInternationalString(sbDescription));
            sb.setAccessURI(accessURI);
            sb.addSpecificationLink(sl);
            service.addServiceBinding(sb);
            Collection sbs = new ArrayList();
            sbs.add(sb);
            br = blm.saveServiceBindings(sbs);
            if (br.getExceptions() != null)
            {
                fail("Save ServiceBindings failed ");
            }


            Collection specifications = new ArrayList();
            specifications.add(testConcept);

            br = bqm.findServiceBindings(serviceKey, null, null, specifications);
            sbs = br.getCollection();
            iter = sbs.iterator();
            while (iter.hasNext())
            {
                sb = (ServiceBinding) iter.next();
                Service storedService = sb.getService();
                if (!(storedService.getName().getValue().equals(serviceName)))
                {
                    fail("Error: service name");
                }
                Organization storedOrg = storedService.getProvidingOrganization();
                if (!(storedOrg.getName().getValue().equals(orgname)))
                {
                    fail("Error: unexpected organization name \n");
                }
                if (!(sb.getDescription().getValue().equals(sbDescription)))
                {
                    fail("Error: servicebinding description");
                }
                if (!(sb.getAccessURI().equals(accessURI)))
                {
                    fail("Error: unexpected accessURI name");
                }
            }

            //Lets update the ServiceBinding
            sbs = new ArrayList();
            sb.setAccessURI("http://newURI");
            sbs.add(sb);
            br = blm.saveServiceBindings(sbs);
            br = bqm.findServiceBindings(serviceKey, null, null, specifications);
            sbs = br.getCollection();
            iter = sbs.iterator();
            while (iter.hasNext())
            {
                sb = (ServiceBinding) iter.next();
                Service storedService = sb.getService();
View Full Code Here

Examples of javax.xml.registry.BulkResponse

           getJAXREssentials();
           Collection orgs = new ArrayList();
           Organization org = createOrganization("JBOSS");

           orgs.add(org);
           BulkResponse br = blm.saveOrganizations(orgs);
           if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
           {
               Collection coll = br.getCollection();
               Iterator iter = coll.iterator();
               while (iter.hasNext())
               {
                   Key key = (Key) iter.next();
                   keyid = key.getId();
                   assertNotNull(keyid);
                   orgKey = key;
               }//end while
           } else
           {
               Collection exceptions = br.getExceptions();
               Iterator iter = exceptions.iterator();
               while (iter.hasNext())
               {
                   Exception e = (Exception) iter.next();
                   fail(e.toString());
View Full Code Here

Examples of javax.xml.registry.BulkResponse

            getJAXREssentials();
            Collection orgs = new ArrayList();
            Organization org = createOrganization("JBOSS");

            orgs.add(org);
            BulkResponse br = blm.saveOrganizations(orgs);
            if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
            {
                if ("true".equalsIgnoreCase(debugProp))
                    System.out.println("Organization Saved");
                Collection coll = br.getCollection();
                Iterator iter = coll.iterator();
                while (iter.hasNext())
                {
                    Key key = (Key) iter.next();
                    keyid = key.getId();
                    if ("true".equalsIgnoreCase(debugProp))
                        System.out.println("Saved Key=" + key.getId());
                    assertNotNull(keyid);
                }//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

Examples of javax.xml.registry.BulkResponse

         if (br.getExceptions() != null)
         {
            fail("Error:Save Associations failed \n");
         }
         BulkResponse targetAssoc = bqm.findCallerAssociations(null,
                 new Boolean(true),
                 new Boolean(true),
                 null);

         if (targetAssoc.getExceptions() == null)
         {
            Collection targetCol = targetAssoc.getCollection();
            if (targetCol.size() > 0)
            {
               iter = targetCol.iterator();
               while (iter.hasNext())
               {
View Full Code Here

Examples of javax.xml.registry.BulkResponse

      assertTrue("Classifications are not empty", TYPE.getClassifications().size() > 0);
      System.out.println("TYPE.Classifications = " +TYPE.getClassifications());
      concept.addClassification(blm.createClassification( TYPE, blm.createInternationalString("TEST CLASSIFICATION"), "test portType")  );

      concepts.add(concept);
      BulkResponse response = blm.saveConcepts( concepts );
      if (response != null && response.getCollection().size() > 0)
      {
         concept.setKey((Key)response.getCollection().iterator().next() );
         assertNotNull("Key created != null", concept.getKey());
         System.out.println("Concept Key = " + concept.getKey() + "\".");
      }
     
      //Obtain the saved concepts
View Full Code Here

Examples of org.apache.oozie.client.BulkResponse

     * @return a list of bulk response beans from a JSON array.
     */
    public static List<BulkResponse> createBulkResponseList(JSONArray json) {
        List<BulkResponse> list = new ArrayList<BulkResponse>();
        for (Object obj : json) {
            BulkResponse bulkObj = (BulkResponse) Proxy.newProxyInstance
                    (JsonToBean.class.getClassLoader(), new Class[]{BulkResponse.class},
                    new JsonInvocationHandler(BULK_RESPONSE, (JSONObject) obj));
            list.add(bulkObj);
        }
        return list;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.