//---------------------------------------------------------------------------
public ListResponse processRequest(TokenListRequest req, int pos, SearchResult result, ServiceContext context) throws Exception {
//--- loop to retrieve metadata
ListIdentifiersResponse res = new ListIdentifiersResponse();
int num = 0;
while (num<Lib.MAX_RECORDS && pos < result.getIds().size())
{
int id = result.getIds().get(pos);
Header h = buildHeader(context, id, result.prefix);
if (h != null)
{
res.addHeader(h);
num++;
}
pos++;
}