//String qname= "%S%";
String qname = "%";
names.add(qname);
Collection fQualifiers = new ArrayList();
fQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
BulkResponse br = bqm.findOrganizations(fQualifiers,
names, null, null, null, null);
if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
System.out.println("Successfully queried the registry");
System.out.println("for organizations matching the " +
"name pattern: \"" + qname + "\"");
Collection orgs = br.getCollection();
System.out.println("Results found: " + orgs.size() + "\n");
Iterator iter = orgs.iterator();
while (iter.hasNext()) {
Organization org = (Organization) iter.next();
System.out.println("Organization Name: " +
getName(org));
System.out.println("Organization Key: " +
org.getKey().getId());
System.out.println("Organization Description: " +
getDescription(org));
Collection services = org.getServices();
Iterator siter = services.iterator();
while (siter.hasNext()) {
Service service = (Service) siter.next();
System.out.println("\tService Name: " +
getName(service));
System.out.println("\tService Key: " +
service.getKey().getId());
System.out.println("\tService Description: " +
getDescription(service));
}
}
} else {
System.err.println("One or more JAXRExceptions " +
"occurred during the query operation:");
Collection exceptions = br.getExceptions();
Iterator iter = exceptions.iterator();
while (iter.hasNext()) {
Exception e = (Exception) iter.next();
System.err.println(e.toString());
}