Package javax.xml.registry

Examples of javax.xml.registry.BulkResponse


            Creator creator = new Creator(blm);
            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());
            organization.setKey((Key)br.getCollection().iterator().next());
           
            Service service = creator.createService(this.getClass().getName());
            ArrayList<Service> services = new ArrayList<Service>();
            organization.addService(service);
            services.add(service);
            //save service
            BulkResponse br2 = blm.saveServices(services);
            assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
            //remove service
            BulkResponse br3 = blm.deleteServices((Collection<Key>)br2.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br3.getStatus());
            //remove organization
            BulkResponse br4 = blm.deleteOrganizations((Collection<Key>)br.getCollection());
            assertEquals(JAXRResponse.STATUS_SUCCESS, br4.getStatus());
        } catch (JAXRException je) {
            fail(je.getMessage());
        }
    }
View Full Code Here


            Creator creator = new Creator(blm);
            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());
            organization.setKey((Key)br.getCollection().iterator().next());
           
            Service service = creator.createService(this.getClass().getName());
            ArrayList<Service> services = new ArrayList<Service>();
            organization.addService(service);
            services.add(service);
            //save service
            BulkResponse br2 = blm.saveServices(services);
            assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
           
            service.setKey((Key)br2.getCollection().iterator().next());
           
            //save serviceBinding
            ServiceBinding serviceBinding = creator.createServiceBinding();
            service.addServiceBinding(serviceBinding);
            ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
            serviceBindings.add(serviceBinding);
            BulkResponse br5 = blm.saveServiceBindings(serviceBindings);
            assertEquals(BulkResponse.STATUS_SUCCESS, br5.getStatus());
           
            //remove serviceBindings
            BulkResponse br6 = blm.deleteServiceBindings((Collection<Key>)br5.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br6.getStatus());
           
            //remove service
            BulkResponse br3 = blm.deleteServices((Collection<Key>)br2.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br3.getStatus());
            //remove organization
            BulkResponse br4 = blm.deleteOrganizations((Collection<Key>)br.getCollection());
            assertEquals(JAXRResponse.STATUS_SUCCESS, br4.getStatus());
        } catch (JAXRException je) {
            fail(je.getMessage());
        }
    }
View Full Code Here

            Concept concept = blm.createConcept(null, "TestConcept", "");
            InternationalString is = blm.createInternationalString("This is the concept for Apache Scout Test");
            concept.setDescription(is);
            concepts.add(concept);

            BulkResponse br = blm.saveConcepts(concepts);
            assertEquals(BulkResponse.STATUS_SUCCESS, br.getStatus());
           
            BulkResponse br2 = blm.deleteConcepts((Collection<Key>)br.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
        } catch (JAXRException je) {
            fail(je.getMessage());
        }
    }
View Full Code Here

            Organization sOrg = creator.createOrganization("sourceOrg");
            Organization tOrg = creator.createOrganization("targetOrg");
            Collection<Organization> organizations = new ArrayList<Organization>();
            organizations.add(sOrg);
            organizations.add(tOrg);
            BulkResponse br = blm.saveOrganizations(organizations);
            assertEquals(BulkResponse.STATUS_SUCCESS, br.getStatus());
            //setting the keys on the organizations
            Collection<Key> keys = (Collection<Key>) br.getCollection();
            Iterator<Key> iterator = keys.iterator();
            sOrg.setKey(iterator.next());
            tOrg.setKey(iterator.next());
            //creating the RelatedTo Association between these two organizations
            Concept type = bqm.findConceptByPath("/AssociationType/RelatedTo");
            Association association = blm.createAssociation(tOrg, type);
            sOrg.addAssociation(association);
            ArrayList<Association> associations = new ArrayList<Association>();
            associations.add(association);
            //save associations
            BulkResponse br2 = blm.saveAssociations(associations, true);
            assertEquals(BulkResponse.STATUS_SUCCESS, br2.getStatus());
           
            //delete association
            BulkResponse br3 = blm.deleteAssociations(br2.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br3.getStatus());
           
            //delete organizations
            BulkResponse br4 = blm.deleteOrganizations((Collection<Key>)br.getCollection());
            assertEquals(BulkResponse.STATUS_SUCCESS, br4.getStatus());
          
        } catch (JAXRException je) {
            fail(je.getMessage());
      je.printStackTrace();
        }
View Full Code Here

        RegistryService rs = connection.getRegistryService();
        BusinessQueryManager bqm = rs.getBusinessQueryManager();
        blm = rs.getBusinessLifeCycleManager();

        InternationalString is;
        BulkResponse br;
        Key key;
        Locale locale = Locale.GERMAN;

        // create Organization
       
        Organization organization = (Organization) blm.createObject(BusinessLifeCycleManager.ORGANIZATION);

        is = getIString(locale, "Apache Scout Org");
        is.setValue(Locale.JAPANESE, "Apache Scoot Org");
        organization.setName(is);
        is = getIString(locale, "This is the org for Apache Scout Test");
        is.setValue(Locale.JAPANESE, "This is the org for Apache Scout Test");
        organization.setDescription(is);

        Collection<Organization> organizations = new ArrayList<Organization>();
        organizations.add(organization);

        br = blm.saveOrganizations(organizations);
        checkResponse(br);

        assertEquals(1, br.getCollection().size());
        key = (Key) br.getCollection().iterator().next();

        Organization organization1 = (Organization) bqm.getRegistryObject(key.getId(), LifeCycleManager.ORGANIZATION);

        System.out.println(organization1.getName().getValue() + " " + organization1.getDescription().getValue());
       
        assertEquals(organization.getName().getValue(locale),
                     organization1.getName().getValue(locale));
        assertEquals(organization.getName().getValue(Locale.JAPANESE),
                organization1.getName().getValue(Locale.JAPANESE));
       
        assertEquals(organization.getDescription().getValue(locale),
                     organization1.getDescription().getValue(locale));
        assertEquals(organization.getDescription().getValue(Locale.JAPANESE),
                organization1.getDescription().getValue(Locale.JAPANESE));

        // create Service
        Service service = (Service) blm.createObject(BusinessLifeCycleManager.SERVICE);

        is = getIString(locale, "Apache Scout Service");
        is.setValue(Locale.JAPANESE, "Apache Scoot Service");
        service.setName(is);
        is = getIString(locale, "This is the service for Apache Scout Test");
        is.setValue(Locale.JAPANESE, "This is the service for Apache Scoot Test");
        service.setDescription(is);

        organization1.addService(service);
       
        Collection<Service> services = new ArrayList<Service>();
        services.add(service);

        br = blm.saveServices(services);
        checkResponse(br);

        assertEquals(1, br.getCollection().size());
        key = (Key) br.getCollection().iterator().next();

        Service service1 = (Service) bqm.getRegistryObject(key.getId(), LifeCycleManager.SERVICE);

        System.out.println(service1.getName().getValue() + " " + service1.getDescription().getValue());
       
View Full Code Here

        concept.setDescription(is);

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

        BulkResponse br = blm.saveConcepts(concepts);
        checkResponse(br);

        assertEquals(1, br.getCollection().size());
        Key key = (Key) br.getCollection().iterator().next();

        Concept concept1 = (Concept) bqm.getRegistryObject(key.getId(), LifeCycleManager.CONCEPT);

        System.out.println(concept1.getName().getValue() + " " + concept1.getDescription().getValue());
View Full Code Here

    Association association = blm.createAssociation(registryObject, type);
   
    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

     
      String id = key.getId();
      System.out.println("Deleting organization with id " + id);
      Collection<Key> keys = new ArrayList<Key>();
      keys.add(key);
      BulkResponse response = blm.deleteOrganizations(keys);
      Collection exceptions = response.getExceptions();
      if (exceptions == null) {
        System.out.println("Organization deleted");
        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();
View Full Code Here

        System.out.println("Deleting concept with id " + id);

        Collection<Key> keys = new ArrayList<Key>();
        keys.add(key);
        BulkResponse response = blm.deleteClassificationSchemes(keys);
       
        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();
View Full Code Here

        System.out.println("Deleting concept with id " + id);

        Collection<Key> keys = new ArrayList<Key>();
        keys.add(key);
        BulkResponse response = blm.deleteConcepts(keys);
       
        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();
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.