added some logs, fix updateVO method

This commit is contained in:
roberto cirillo 2020-07-17 15:58:08 +02:00
parent 86c0f93067
commit 30b505fa4e
2 changed files with 12 additions and 6 deletions

View File

@ -112,8 +112,8 @@ public class RegistryPublisherImpl implements RegistryPublisher {
//in this case it is a root-vo scope so we need to create the resource only at root-vo level //in this case it is a root-vo scope so we need to create the resource only at root-vo level
}else{ }else{
RegistryStub stub = getRegistryStub(); RegistryStub stub = getRegistryStub();
createResource(resource, currentVO, stub); createResource(resource, currentScope, stub);
return resource; vosScopes.remove(currentScope);
} }
} }
// update the resource for each VO // update the resource for each VO
@ -237,12 +237,14 @@ public class RegistryPublisherImpl implements RegistryPublisher {
if (currentVO != null){ if (currentVO != null){
ScopeProvider.instance.set(currentVO); ScopeProvider.instance.set(currentVO);
registryUpdate(resource, 0); registryUpdate(resource, 0);
log.debug("currentVO "+currentVO+" updated");
vosScopes.remove(currentVO); vosScopes.remove(currentVO);
// in this case it is a root-vo scope so we need to update the resource only at root-vo level // in this case it is a root-vo scope so we need to update the resource only at root-vo level
}else{ }else{
ScopeProvider.instance.set(currentScope); ScopeProvider.instance.set(currentScope);
registryUpdate(resource, 0); registryUpdate(resource, 0);
return resource; log.debug("currentVO "+currentScope+" is the root-vo");
vosScopes.remove(currentScope);
} }
} }

View File

@ -63,11 +63,15 @@ public class Utils {
for(String scope: resource.scopes()){ for(String scope: resource.scopes()){
log.debug("processing scope: "+scope); log.debug("processing scope: "+scope);
ScopeBean scopeBean = new ScopeBean(scope); ScopeBean scopeBean = new ScopeBean(scope);
if(scopeBean.is(Type.VRE)) if(scopeBean.is(Type.VRE)) {
vosScopes.add(scopeBean.enclosingScope().toString()); String enclosedVO=scopeBean.enclosingScope().toString();
else vosScopes.add(enclosedVO);
log.debug(enclosedVO+" VO scope added");
}else {
// if the scope is a root-vo scope, it will be added to the vosScope array // if the scope is a root-vo scope, it will be added to the vosScope array
vosScopes.add(scope); vosScopes.add(scope);
log.debug(scope+" VO scope added");
}
} }
return vosScopes; return vosScopes;
} }