diff --git a/src/main/java/org/gcube/smartgears/handlers/AbstractProfilePublisher.java b/src/main/java/org/gcube/smartgears/handlers/AbstractProfilePublisher.java index eaa3752..9bf4931 100644 --- a/src/main/java/org/gcube/smartgears/handlers/AbstractProfilePublisher.java +++ b/src/main/java/org/gcube/smartgears/handlers/AbstractProfilePublisher.java @@ -7,9 +7,7 @@ import java.util.ArrayList; import java.util.Collection; import java.util.Set; -import org.gcube.common.authorization.library.provider.SecurityTokenProvider; import org.gcube.common.resources.gcore.Resource; -import org.gcube.common.scope.api.ScopeProvider; import org.gcube.informationsystem.publisher.ScopedPublisher; import org.gcube.smartgears.provider.ProviderFactory; import org.slf4j.Logger; @@ -44,11 +42,7 @@ public abstract class AbstractProfilePublisher
implements Pr
log.debug("using context {}",contextCL.getClass().getSimpleName());
- String previousToken = SecurityTokenProvider.instance.get();
- String previousScope = ScopeProvider.instance.get();
try{//This classloader set is needed for the jaxb context
- if (previousToken!=null)
- SecurityTokenProvider.instance.reset();
if (isRoot())
Thread.currentThread().setContextClassLoader(AbstractProfilePublisher.class.getClassLoader());
profile = publisher.remove(profile, new ArrayList implements Pr
} catch (Exception e) {
rethrowUnchecked(e);
} finally{
- SecurityTokenProvider.instance.set(previousToken);
- ScopeProvider.instance.set(previousScope);
if (isRoot())
Thread.currentThread().setContextClassLoader(contextCL);
}
@@ -69,7 +61,7 @@ public abstract class AbstractProfilePublisher implements Pr
public void addToAll(){
this.addTo(getAllowedContexts());
}
-
+
/**
* Adds for the first time the current resource profile of the application in one or more scopes.
* @param contexts the contexts
@@ -83,20 +75,12 @@ public abstract class AbstractProfilePublisher implements Pr
log.debug("using context {}",contextCL.getClass().getSimpleName());
- String previousToken = SecurityTokenProvider.instance.get();
- String previousScope = ScopeProvider.instance.get();
try{//This classloader set is needed for the jaxb context
- if (previousToken!=null)
- SecurityTokenProvider.instance.reset();;
- if (isRoot()) Thread.currentThread().setContextClassLoader(AbstractProfilePublisher.class.getClassLoader());
- ScopeProvider.instance.set(contexts.stream().findFirst().get());
- profile = publisher.create(profile, new ArrayList implements Pr
log.debug("using context {}",contextCL.getClass().getSimpleName());
- String previousToken = SecurityTokenProvider.instance.get();
- String previousScope = ScopeProvider.instance.get();
try{//This classloader set is needed for the jaxb context
- if (previousToken!=null)
- SecurityTokenProvider.instance.reset();
if (isRoot())
Thread.currentThread().setContextClassLoader(AbstractProfilePublisher.class.getClassLoader());
@@ -125,8 +105,6 @@ public abstract class AbstractProfilePublisher implements Pr
} catch (Exception e) {
rethrowUnchecked(e);
} finally{
- SecurityTokenProvider.instance.set(previousToken);
- ScopeProvider.instance.set(previousScope);
if (isRoot())
Thread.currentThread().setContextClassLoader(contextCL);
}
diff --git a/src/main/java/org/gcube/smartgears/utils/InnerMethodName.java b/src/main/java/org/gcube/smartgears/utils/InnerMethodName.java
index 9c81c21..692975d 100644
--- a/src/main/java/org/gcube/smartgears/utils/InnerMethodName.java
+++ b/src/main/java/org/gcube/smartgears/utils/InnerMethodName.java
@@ -1,6 +1,5 @@
package org.gcube.smartgears.utils;
-import org.gcube.common.authorization.library.provider.CalledMethodProvider;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -8,7 +7,7 @@ public class InnerMethodName {
public static InnerMethodName instance = new InnerMethodName();
- private static Logger logger = LoggerFactory.getLogger(CalledMethodProvider.class);
+ private static Logger logger = LoggerFactory.getLogger(InnerMethodName.class);
// Thread local variable containing each thread's ID
private static final InheritableThreadLocal