Package javax.xml.registry

Examples of javax.xml.registry.BusinessQueryManager


    {
        login();
        try
        {
            RegistryService rs = connection.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            blm = rs.getBusinessLifeCycleManager();
            Printer printer = new Printer();
            Remover remover = new Remover(blm);

            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)
View Full Code Here


*/
public class BusinessQueryManagerTest extends TestCase {

    public void testFindClassificationSchemeByName() throws JAXRException {

        BusinessQueryManager blm = new BusinessQueryManagerV3Impl(new RegistryServiceImpl(null, null, -1, "3.0"));

        ClassificationScheme scheme = blm.findClassificationSchemeByName(null, "AssociationType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 15);

        scheme = blm.findClassificationSchemeByName(null, "ObjectType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 16);

        scheme = blm.findClassificationSchemeByName(null, "ObjectType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 16);

        scheme = blm.findClassificationSchemeByName(null, "PhoneType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 5);

        scheme = blm.findClassificationSchemeByName(null, "URLType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 6);

        scheme = blm.findClassificationSchemeByName(null, "PostalAddressAttributes");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 6);

    }
View Full Code Here

    @Test
    public void testPublishOrganizationAndService() throws Exception {
        login();

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

   
    public void testPublishConcept() throws Exception {
        login();

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

        Locale locale = Locale.GERMAN;

        Concept concept = (Concept) blm.createObject(BusinessLifeCycleManager.CONCEPT);
        InternationalString is;

        is = getIString(locale, "Apache Scout Concept -- APACHE SCOUT TEST");
        concept.setName(is);
        is = getIString(locale, "This is the concept for Apache Scout Test");
        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());

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

  public void testGetRegistryObjects() {
        login();
        try {
          RegistryService rs = connection.getRegistryService();

          BusinessQueryManager bqm = rs.getBusinessQueryManager();
          @SuppressWarnings("unused")
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
          @SuppressWarnings("unused")
      BulkResponse br = bqm.getRegistryObjects();
    } catch (JAXRException e) {
      e.printStackTrace();
    }
  }
View Full Code Here

  public void testFindRegistryPackages() throws JAXRException{
        login();
       
          RegistryService rs = connection.getRegistryService();

          BusinessQueryManager bqm = rs.getBusinessQueryManager();
          @SuppressWarnings("unused")
      BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();

          Concept type = bqm.findConceptByPath("/AssociationType/RelatedTo");

          ArrayList namePatterns = new ArrayList();
          namePatterns.add("%foo%");
         
          ArrayList classifications = new ArrayList();
          classifications.add(type);

          @SuppressWarnings("unused")
      BulkResponse br = bqm.findRegistryPackages(null, namePatterns, classifications, null);
          fail("findRegistryPackages is currently unsupported");
         
//          assertEquals(null, br.getExceptions());
//          assertEquals(br.getCollection().size(), 0);
//         
View Full Code Here

    {
        login();
        try
        {
            RegistryService rs = connection.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            blm = rs.getBusinessLifeCycleManager();
            Remover remover = new Remover(blm);

            ClassificationScheme cScheme = blm.createClassificationScheme("testScheme -- APACHE SCOUT TEST", "Sample Classification Scheme");
            Classification classification = createClassificationForUDDI(bqm);
View Full Code Here

        if (org == null) {
          if (super.getSubmittingOrganization() != null) {
            return super.getSubmittingOrganization();
          } else {
            RegistryService rs = super.getLifeCycleManager().getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
                Organization o = (Organization) bqm.getRegistryObject(orgKey,
                        LifeCycleManager.ORGANIZATION);
                setProvidingOrganization(o)
                return o;
          }
        }
View Full Code Here

        try
        {
            // Get registry service and business query manager
            RegistryService rs = connection.getRegistryService();
            BusinessQueryManager bqm = rs.getBusinessQueryManager();
            System.out.println("We have the Business Query Manager");

            // Define find qualifiers and name patterns
            Collection findQualifiers = new ArrayList();
            findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
            Collection namePatterns = new ArrayList();
            namePatterns.add("%" + queryString + "%");

            // 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);
View Full Code Here

*/
public class BusinessQueryManagerImplTest extends TestCase {

    public void testFindClassificationSchemeByName() throws JAXRException {

        BusinessQueryManager blm = new BusinessQueryManagerImpl(new RegistryServiceImpl(null, null, -1));

        ClassificationScheme scheme = blm.findClassificationSchemeByName(null, "AssociationType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 15);

        scheme = blm.findClassificationSchemeByName(null, "ObjectType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 16);

        scheme = blm.findClassificationSchemeByName(null, "ObjectType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 16);

        scheme = blm.findClassificationSchemeByName(null, "PhoneType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 5);

        scheme = blm.findClassificationSchemeByName(null, "URLType");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 6);

        scheme = blm.findClassificationSchemeByName(null, "PostalAddressAttributes");
        assertNotNull(scheme);
        assertTrue(scheme.getChildConceptCount() == 6);

    }
View Full Code Here

TOP

Related Classes of javax.xml.registry.BusinessQueryManager

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.