class DeleteOnQueryResultHandler implements ResultHandler<Collection<PartialToken>, CoreTokenException> {

    @Override
    public void processResults(Collection<PartialToken> results) {
        String tokenId = null;
        for (PartialToken result : results) {
            try {
                tokenId = result.getValue(CoreTokenField.TOKEN_ID);
                taskDispatcher.delete(tokenId, resultHandlerFactory.getDeleteHandler());
            } catch (CoreTokenException ex) {
                debug.error(String.format("Unable to submit delete task for token ID {0}", tokenId), ex);
            }
        }
    }

    @Inject public  DeleteOnQueryResultHandler(TaskDispatcher taskDispatcher, ResultHandlerFactory resultHandlerFactory,
            @Named(CoreTokenConstants.CTS_DEBUG) Debug debug);

}