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
}else{
RegistryStub stub = getRegistryStub();
createResource(resource, currentVO, stub);
return resource;
createResource(resource, currentScope, stub);
vosScopes.remove(currentScope);
}
}
// update the resource for each VO
@ -237,12 +237,14 @@ public class RegistryPublisherImpl implements RegistryPublisher {
if (currentVO != null){
ScopeProvider.instance.set(currentVO);
registryUpdate(resource, 0);
log.debug("currentVO "+currentVO+" updated");
vosScopes.remove(currentVO);
// in this case it is a root-vo scope so we need to update the resource only at root-vo level
}else{
ScopeProvider.instance.set(currentScope);
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()){
log.debug("processing scope: "+scope);
ScopeBean scopeBean = new ScopeBean(scope);
if(scopeBean.is(Type.VRE))
vosScopes.add(scopeBean.enclosingScope().toString());
else
if(scopeBean.is(Type.VRE)) {
String enclosedVO=scopeBean.enclosingScope().toString();
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
vosScopes.add(scope);
log.debug(scope+" VO scope added");
}
}
return vosScopes;
}