//---------------------------------------------------------------------------
public AbstractResponse execute(AbstractRequest request, ServiceContext context) throws Exception
{
ListSetsRequest req = (ListSetsRequest) request;
ListSetsResponse res = new ListSetsResponse();
//--- we don't provide streaming for sets
if (req.getResumptionToken() != null)
throw new BadResumptionTokenException(req.getResumptionToken());
final List<MetadataCategory> metadataCategories = context.getBean(MetadataCategoryRepository.class).findAll();
for (MetadataCategory rec : metadataCategories)
{
String name = rec.getName();
String label = rec.getLabel(context.getLanguage());
res.addSet(new SetInfo(name, label));
}
return res;
}