resp.sendError(HttpStatus.SC_FORBIDDEN);
return;
}
final String searchNumber = NumberHelper.extractPhonenumber(number);
final AddressDao addressDao = (AddressDao) Registry.instance().getDao(AddressDao.class);
final BaseSearchFilter filter = new BaseSearchFilter();
filter.setSearchString("*" + searchNumber);
final QueryFilter queryFilter = new QueryFilter(filter);
final StringBuffer buf = new StringBuffer();
// Use internal get list method for avoiding access checking (no user is logged-in):
final List<AddressDO> list = addressDao.internalGetList(queryFilter);
if (list != null && list.size() >= 1) {
AddressDO result = list.get(0);
if (list.size() > 1) {
// More than one result, therefore find the newest one:
buf.append("+"); // Mark that more than one entry does exist.