for (Capability cap : getFallbackRepository().findProviders(req)) {
Resource res = cap.getResource();
ResourceIdentity resid = res.getIdentity();
Resource storageResource = repositoryStorage.getResource(resid);
if (storageResource == null) {
storageResource = repositoryStorage.addResource(res);
for (Capability aux : storageResource.getCapabilities(req.getNamespace())) {
if (cap.getAttributes().equals(aux.getAttributes())) {
cap = aux;
break;
}