Package javax.xml.registry.infomodel

Examples of javax.xml.registry.infomodel.Organization


      String keyid = "";
      jaxrLogin();

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

      orgs.add(org);
      BulkResponse br = blm.saveOrganizations(orgs);
      if (br.getStatus() == JAXRResponse.STATUS_SUCCESS)
      {
View Full Code Here


   * Tests the successful creation of the RED HAT/JBossESB Organization.
   */
  @Test
  public void publishOrganization() throws ConfigurationException, JAXRException {
        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
    Organization org = JAXRRegistryImpl.createJBossESBOrganization(jaxrConnectionFactory);
    logger.debug("Succesfully created organization: " + org.getName().getValue());
    assertEquals("Red Hat/JBossESB", org.getName().getValue());
  }
View Full Code Here

    assertEquals("Red Hat/JBossESB", org.getName().getValue());
  }
  @Test
  public void findOrganization() throws ConfigurationException, JAXRException {
        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
    Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
    logger.debug("Succesfully created organization: " + org.getName().getValue());
    assertEquals("Red Hat/JBossESB", org.getName().getValue());

    Organization nullOrg = JAXRRegistryImpl.findOrganization("Not Existing Org", jaxrConnectionFactory);
    logger.debug("Could not find non-existing organization.");
    assertEquals(null, nullOrg);
  }
View Full Code Here

   * @throws Exception
   */
  @Test
  public void findServicesForAnOrganization() throws Exception {
        JAXRConnectionFactory jaxrConnectionFactory = new JAXRConnectionFactory();
    Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);
    //Listing out the services and their Bindings
    logger.debug("-------------------------------------------------");
    logger.debug("Organization name: " + org.getName().getValue());
    logger.debug("Description: " + org.getDescription().getValue());
    logger.debug("Key id: " + org.getKey().getId());
    User primaryContact = org.getPrimaryContact();
    logger.debug("Primary Contact: " + primaryContact.getPersonName().getFullName());
    Collection services = org.getServices();
    for (Iterator serviceIter = services.iterator();serviceIter.hasNext();) {
      Service service = (Service) serviceIter.next();
      logger.debug("- Service Name: " + service.getName().getValue());
      logger.debug("  Service Key : " + service.getKey().getId());
      Collection serviceBindings = service.getServiceBindings();
View Full Code Here

   * @throws JAXRException
   */
  protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException
  {
    Service service =null;
    Organization organization = getJBossESBOrganization();
    Connection connection = JAXRConnectionSingleton.getConnection(jaxrConnectionFactory);
    try {
      RegistryService rs = connection.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
        //Adding the category as prefix for the name
      service = blm.createService(blm.createInternationalString(serviceName));
      if (isV3 && ((serviceDescription == null) || ("".equals(serviceDescription)))) {
        service.setDescription(blm.createInternationalString(SERVICE_DESCRIPTION));
      } else {
        service.setDescription(blm.createInternationalString(serviceDescription));
      }
      ClassificationScheme cScheme = getClassificationScheme(bqm, blm);
            Classification classification = blm.createClassification(cScheme, "category", category);
      service.addClassification(classification);
      organization.addService(service);
      saveRegistryObject(service, jaxrConnectionFactory);
    } finally {
      JAXRConnectionSingleton.recycleConnection(jaxrConnectionFactory, connection);
    }
    return service;
View Full Code Here

      BulkResponse response = bqm.findOrganizations(findQualifiers,
          namePatterns, null, null, null, null);
      if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
        for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();)
        {
          Organization org = (Organization) orgIter.next();
          logger.log(Level.DEBUG, "Organization name: " + org.getName().getValue());
          logger.log(Level.DEBUG, "Description: " + org.getDescription().getValue());
          logger.log(Level.DEBUG, "Key id: " + org.getKey().getId());
          User primaryContact = org.getPrimaryContact();
          logger.log(Level.DEBUG, "Primary Contact: " + primaryContact.getPersonName().getFullName());
          if (orgIter.hasNext()) {
            logger.log(Level.ERROR, "Found " + response.getCollection().size()
                + " Organization, while expecting only one of name " + organizationName);
          }
View Full Code Here

    try {
      //Logging in
      RegistryService rs = connection.getRegistryService();
      //Building organization
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
      Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
        organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));

      User user = blm.createUser();
      organization.setPrimaryContact(user);
      PersonName personName = blm.createPersonName("JBossESB");
      TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
      telephoneNumber.setNumber("404 467-8555");
      telephoneNumber.setType(null);
      PostalAddress address = blm.createPostalAddress("3340",
View Full Code Here

   * @return JBossESB Organization
   * @throws JAXRException
   */
  private Organization getJBossESBOrganization() throws JAXRException
  {
    Organization jbossESBOrganization = findOrganization("Red Hat/JBossESB", jaxrConnectionFactory);

    if (jbossESBOrganization==null) {
      jbossESBOrganization = createJBossESBOrganization(jaxrConnectionFactory);
    }
   
View Full Code Here

        try
        {
            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();
                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)))
                {
View Full Code Here

            blm2 = rs2.getBusinessLifeCycleManager();
            bqm2 = rs2.getBusinessQueryManager();
            String orgTarget = "Target Organization";
            String orgSource = "Source Organization";

            Organization target = blm2.createOrganization(blm.createInternationalString(orgTarget));
            Organization source = blm.createOrganization(blm.createInternationalString(orgSource));

            Collection orgs = new ArrayList();
            orgs.add(source);
            br = blm.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail(" Source::Save Organizations failed");
            }
            sourceKeys = br.getCollection();
            Iterator iter = sourceKeys.iterator();
            while (iter.hasNext())
            {
                savekey = (Key) iter.next();
            }
            String sourceid = savekey.getId();
            String objectType = LifeCycleManager.ORGANIZATION;

            Organization pubSource = (Organization) bqm.getRegistryObject(sourceid, objectType);
            assertNotNull("Source Org", pubSource.getName().getValue());

            orgs.clear();
            orgs.add(target);
            br = blm2.saveOrganizations(orgs);
            if (br.getExceptions() != null)
            {
                fail("Target:: Save Organizations failed");
            }
            targetKeys = br.getCollection();
            iter = targetKeys.iterator();
            while (iter.hasNext())
            {
                savekey = (Key) iter.next();
            }
            String targetid = savekey.getId();
            Organization targetOrg = (Organization) bqm2.getRegistryObject(targetid, objectType);
            assertNotNull("Target Org", targetOrg.getName().getValue());

            Concept associationType = getAssociationConcept("Implements");
            assertNotNull("AssociationType", associationType);

            Association a = blm.createAssociation(targetOrg, associationType);
View Full Code Here

TOP

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

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.