BusinessQueryManager queryManager = null; BusinessLifeCycleManager lifeCycleManager = null; ... // Define find qualifiers and name patterns Collection findQualifiers = new ArrayList(); findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC); ClassificationScheme classificationScheme = queryManager.findClassificationSchemeByName( cName ); Classification classification = lifeCycleManager.createClassification( classificationScheme, keyName, keyValue ); Collection classifications = new ArrayList(); classifications.add ( classification ); // Find using the Classification Info BulkResponse response = queryManager.findOrganizations(findQualifiers, null, classifications, null, null, null); Collection orgs = response.getCollection(); // Display information about the organizations found Iterator orgIter = orgs.iterator(); while (orgIter.hasNext()) { Organization org = (Organization) orgIter.next(); System.out.println("Org name: " + getName(org)); System.out.println("Org description: " + getDescription(org)); System.out.println("Org key id: " + getKey(org)); // Display primary contact information User pc = org.getPrimaryContact(); if (pc != null) { PersonName pcName = pc.getPersonName(); System.out.println(" Contact name: " + pcName.getFullName()); Collection phNums = pc.getTelephoneNumbers(pc.getType()); Iterator phIter = phNums.iterator(); while (phIter.hasNext()) { TelephoneNumber num = (TelephoneNumber) phIter.next(); System.out.println(" Phone number: " + num.getNumber()); } Collection eAddrs = pc.getEmailAddresses(); Iterator eaIter = eAddrs.iterator(); while (phIter.hasNext()) { System.out.println(" Email Address: " + (EmailAddress) eaIter.next()); } } // Display service and binding information Collection services = org.getServices(); Iterator svcIter = services.iterator(); while (svcIter.hasNext()) { Service svc = (Service) svcIter.next(); System.out.println(" Service name: " + getName(svc)); System.out.println(" Service description: " + getDescription(svc)); Collection serviceBindings = svc.getServiceBindings(); Iterator sbIter = serviceBindings.iterator(); while (sbIter.hasNext()) { ServiceBinding sb = (ServiceBinding) sbIter.next(); System.out.println(" Binding " + "Description: " + getDescription(sb)); System.out.println(" Access URI: " + sb.getAccessURI()); Collection specLinks = sb.getSpecificationLinks(); Iterator specLinkIterator = specLinks.iterator(); while ( specLinkIterator.hasNext() ) { SpecificationLink sl = (SpecificationLink)specLinkIterator.next(); RegistryObject ro = sl.getSpecificationObject(); System.out.println("Specification Object description :" + getDescription( ro) ); Collection elc = sl.getExternalLinks(); Iterator eli = elc.iterator(); while( eli.hasNext() ) { ExternalLink el = (ExternalLink)eli.next(); System.out.println("External URI : " + el.getExternalURI( ) ); } }