@Override
protected void execute() throws Exception {
//Name of business were looking for in English.
int max = 5;
Name q = new Name();
q.setLang("en");
q.setValue(businessName);
//Optional qualifiers that will modify the search.
FindQualifiers findQualifiers = new FindQualifiers();
findQualifiers.getFindQualifier().add("sortByNameDesc");
findQualifiers.getFindQualifier().add("approximateMatch");
//The FindBusiness object that is submitted via the inquiry service.
FindBusiness findBusiness = new FindBusiness();
findBusiness.setAuthInfo(authenticationToken.getAuthInfo());
findBusiness.getName().add(q);
findBusiness.setFindQualifiers(findQualifiers);
findBusiness.setMaxRows(max);
BusinessList businessList = inquiryService.findBusiness(findBusiness);
businessInfos = businessList.getBusinessInfos();
//Print out the names of the returned businesses
for (BusinessInfo bi : businessInfos.getBusinessInfo()) {
if (businessInfo == null) {
businessInfo = bi;
}
Name _name = bi.getName().get(0);
System.out.println("BusinessInfo: " + _name.getValue());
}
}