class ServiceResourceService {

    @EventListener
    public void reportArchiveUsage(ArchiveUsageRequestEvent event) {
        ServiceResource[] serviceResources = alienDAO.buildQuery(ServiceResource.class)
                .setFilters(fromKeyValueCouples("dependency.name", event.getArchiveName(), "dependency.version", event.getArchiveVersion())).prepareSearch()
                .search(0, Integer.MAX_VALUE).getData();
        for (ServiceResource serviceResource : serviceResources) {
            Usage usage = new Usage(serviceResource.getName(), ServiceResource.class.getSimpleName().toLowerCase(), serviceResource.getId(), "");
            event.addUsage(usage);
        }
    }

}