Package javax.xml.registry.infomodel

Examples of javax.xml.registry.infomodel.Key


            concept.addClassification(cl);

            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());
                    fail(e.toString());
                }
            }
           
            Concept savedConcept = (Concept)bqm.getRegistryObject(key.getId(),LifeCycleManager.CONCEPT);
            System.out.println("Save concept=" + savedConcept);
           
        } catch (JAXRException e)
        {
            e.printStackTrace();
View Full Code Here


  private void deleteTempOrgs() {

    try {

      Key sOrgKey = sOrg.getKey();
      Key tOrgKey = tOrg.getKey();

      System.out.println("\nDeleting temporary organizations with ids "
          + 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();
          System.out.println("Organization with ID=" + id
              + " was deleted");
        }
      }
    } catch (JAXRException jaxre) {
View Full Code Here

        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());
       
        assertEquals(service.getName().getValue(locale),
                     service1.getName().getValue(locale));
View Full Code Here

        this.blm = blm;
    }
   
    public void removeOrganization(Organization org) throws JAXRException {

      Key key = org.getKey();
     
      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();
View Full Code Here

    }
   
    public void removeClassificationScheme(ClassificationScheme cs)
    throws JAXRException
    {
        Key key = cs.getKey();
        String id = key.getId();

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

        Collection<Key> keys = new ArrayList<Key>();
        keys.add(key);
View Full Code Here

    }
   
    public void removeConcept(Concept concept)
    throws JAXRException
    {
        Key key = concept.getKey();
        String id = key.getId();

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

        Collection<Key> keys = new ArrayList<Key>();
        keys.add(key);
View Full Code Here

    }
   
    public void removeService(Service service)
    throws JAXRException
    {
        Key key = service.getKey();
        String id = key.getId();

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

        Collection<Key> keys = new ArrayList<Key>();
        keys.add(key);
View Full Code Here

    }
   
    public void removeServiceBinding(ServiceBinding serviceBinding)
    throws JAXRException
    {
        Key key = serviceBinding.getKey();
        String id = key.getId();

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

        Collection<Key> keys = new ArrayList<Key>();
        keys.add(key);
View Full Code Here

        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());

     
        assertEquals(concept.getName().getValue(locale),
View Full Code Here

            System.out.println("Object saved.");
            Collection coll = br.getCollection();
            Iterator iter = coll.iterator();
            while (iter.hasNext())
            {
                Key key = (Key) iter.next();
                System.out.println("Saved Key=" + key.getId());
            }//end while
        } else
        {
            System.err.println("JAXRExceptions " +
                    "occurred during save:");
View Full Code Here

TOP

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

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.