bug fix #6314
update to version 2.2.1 git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/vre-management/ResourceManager@142207 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5d58c5f4a5
commit
8b8eec0ff2
2
pom.xml
2
pom.xml
|
@ -11,7 +11,7 @@
|
|||
|
||||
<groupId>org.gcube.resourcemanagement</groupId>
|
||||
<artifactId>resource-manager</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
|
||||
<name>Resource Manager Reactor</name>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<parent>
|
||||
<groupId>org.gcube.resourcemanagement</groupId>
|
||||
<artifactId>resource-manager</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
|
||||
|
|
|
@ -90,22 +90,6 @@ public final class ScopedAnyResource extends ScopedResource {
|
|||
getLogger().error("bad query. Caused by: "+e.getCause());
|
||||
throw new Exception("unable to find the target resource (ID=" + id + "). Possible cause: " + e.getMessage(), e);
|
||||
}
|
||||
// try{
|
||||
// if ((profiles != null) && (profiles.size() > 0)){
|
||||
// logger.info("profile found ");
|
||||
// this.profile = profiles.get(0);
|
||||
// }else{
|
||||
// GCUBEScope enclosingScope=GCUBEScope.getScope(this.scope).getEnclosingScope();
|
||||
// logger.info("profile not found. Try on enclosing scope: "+enclosingScope);
|
||||
// // obviously, in the case of adding, the resource is not in the current scope, therefore we look upstairs (the enclosing scope)
|
||||
// this.profile = (GCUBEResource) client.execute(realquery, enclosingScope).get(0);
|
||||
// }
|
||||
// }catch(Throwable e){
|
||||
// getLogger().error("bad query. Caused by: "+e.getCause());
|
||||
// throw new Exception("unable to find the target resource (ID=" + id + "). Possible cause: " + e.getMessage(), e);
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -114,7 +98,10 @@ public final class ScopedAnyResource extends ScopedResource {
|
|||
getLogger().debug("Adding scope to resource profile");
|
||||
try {
|
||||
profile.addScope(this.getScope());
|
||||
getLogger().debug("republish the resource "+profile.getID()+" with scope added "+this.getScope());
|
||||
|
||||
getLogger().debug("republish the resource "+profile.getID()+" with scope added "+this.getScope()+"with GCubeScope: "+ ServiceContext.getContext().getScope()+" in context "+ServiceContext.getContext());
|
||||
//patch: serviceContext altered by is-publisher
|
||||
GCUBEScope currentServiceContext=ServiceContext.getContext().getScope();
|
||||
//republish the resource
|
||||
ISPublisher publisher = GHNContext.getImplementation(ISPublisher.class);
|
||||
publisher.updateGCUBEResource(this.profile, ServiceContext.getContext().getScope(), ServiceContext.getContext());
|
||||
|
@ -126,6 +113,10 @@ public final class ScopedAnyResource extends ScopedResource {
|
|||
publisher.updateGCUBEResource(this.profile, ServiceContext.getContext().getScope().getEnclosingScope(), ServiceContext.getContext());
|
||||
}
|
||||
}
|
||||
getLogger().debug(": "+profile.getID()+"\n\t the ServiceContext is "+ServiceContext.getContext().getScope());
|
||||
//patch: serviceContext altered by is-publisher
|
||||
ServiceContext.getContext().setScope(currentServiceContext);
|
||||
getLogger().debug("ServiceContext scope restored to: "+currentServiceContext);
|
||||
} catch (Exception e) {
|
||||
this.noHopeForMe("Failed to add the scope ("+ this.getScope()+") to resource " + this.getId(), e);
|
||||
}
|
||||
|
@ -134,8 +125,10 @@ public final class ScopedAnyResource extends ScopedResource {
|
|||
@Override
|
||||
protected void removeFromScope() throws ResourceNotFound, Exception {
|
||||
this.findResource();
|
||||
getLogger().debug("Removing scope from resource profile");
|
||||
getLogger().debug("Removing scope from resource profile");
|
||||
try {
|
||||
//patch: serviceContext altered by is-publisher
|
||||
GCUBEScope currentServiceContext=ServiceContext.getContext().getScope();
|
||||
profile.removeScope(this.getScope());
|
||||
//republish the resource
|
||||
ISPublisher publisher = GHNContext.getImplementation(ISPublisher.class);
|
||||
|
@ -146,6 +139,8 @@ public final class ScopedAnyResource extends ScopedResource {
|
|||
publisher.updateGCUBEResource(this.profile, ServiceContext.getContext().getScope().getEnclosingScope(), ServiceContext.getContext());
|
||||
}
|
||||
}
|
||||
//patch: serviceContext altered by is-publisher
|
||||
ServiceContext.getContext().setScope(currentServiceContext);
|
||||
} catch (Exception e) {
|
||||
this.noHopeForMe("Failed to remove the scope ("+ this.getScope()+") from resource " + this.getId(), e);
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.gcube.resourcemanagement</groupId>
|
||||
<artifactId>resource-manager</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
<artifactId>resource-manager-stubs</artifactId>
|
||||
<name>Resource Manager Stubs</name>
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<parent>
|
||||
<groupId>org.gcube.resourcemanagement</groupId>
|
||||
<artifactId>resource-manager</artifactId>
|
||||
<version>2.2.0-SNAPSHOT</version>
|
||||
<version>2.2.1-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<artifactId>resource-manager-test-suite</artifactId>
|
||||
|
|
Loading…
Reference in New Issue