cleaning after merge
This commit is contained in:
parent
dbaed80d4e
commit
a9df1a1ec2
src/main/java/org/gcube/smartgears
|
@ -23,8 +23,4 @@ public class ManagerPair {
|
|||
}
|
||||
|
||||
|
||||
<<<<<<< HEAD
|
||||
}
|
||||
=======
|
||||
}
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
|
|
|
@ -32,11 +32,7 @@ public class OnlineObserver implements AppManagerObserver{
|
|||
|
||||
private OnlineProvider provider;
|
||||
|
||||
<<<<<<< HEAD
|
||||
private Collection<String> startingTokens;
|
||||
=======
|
||||
private AuthorizationProvider authProvider;
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
|
||||
private Set<Class<? extends ApplicationManager>> managersClasses;
|
||||
|
||||
|
@ -52,13 +48,8 @@ public class OnlineObserver implements AppManagerObserver{
|
|||
}
|
||||
|
||||
@Observes(value=Constants.token_registered, kind=Kind.safe)
|
||||
<<<<<<< HEAD
|
||||
public synchronized void onRegistration(final String securityToken){
|
||||
log.info("token registered called with token {}", securityToken);
|
||||
=======
|
||||
public synchronized void onRegistration(String context){
|
||||
log.info("registration called in context {}", context);
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
List<ManagerPair> futureList = new ArrayList<ManagerPair>();
|
||||
|
||||
try {
|
||||
|
@ -93,24 +84,8 @@ public class OnlineObserver implements AppManagerObserver{
|
|||
|
||||
try {
|
||||
|
||||
<<<<<<< HEAD
|
||||
if(instanciatedManagerPerScope.get(context) != null ) {
|
||||
for (ManagerPair manager: instanciatedManagerPerScope.get(context)){
|
||||
service.execute(new ShutDownAppManager(securityToken, context, manager.getFuture()));
|
||||
provider.getAppmanagerMap().get(manager.getImplementationClass().getCanonicalName()).remove(context);
|
||||
}
|
||||
instanciatedManagerPerScope.remove(context);
|
||||
}
|
||||
=======
|
||||
Secret secret = authProvider.getSecretForContext(context);
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
|
||||
<<<<<<< HEAD
|
||||
SecurityTokenProvider.instance.reset();
|
||||
} catch (ObjectNotFound e1) {
|
||||
log.error("it should never happen (token has just been created)",e1);
|
||||
throw new RuntimeException("it should never happen (token has just been created",e1);
|
||||
=======
|
||||
if(instanciatedManagerPerScope.get(context) != null ) {
|
||||
for (ManagerPair manager: instanciatedManagerPerScope.get(context)){
|
||||
service.execute(new ShutDownAppManager(secret, manager.getFuture()));
|
||||
|
@ -120,7 +95,6 @@ public class OnlineObserver implements AppManagerObserver{
|
|||
}
|
||||
|
||||
instanciatedManagerPerScope.remove(context);
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
} catch (Exception e1) {
|
||||
log.error("something failed getting token",e1);
|
||||
throw new RuntimeException("something failed getting token",e1);
|
||||
|
@ -129,45 +103,9 @@ public class OnlineObserver implements AppManagerObserver{
|
|||
|
||||
public synchronized void onStop(ApplicationContext appContext){
|
||||
|
||||
<<<<<<< HEAD
|
||||
for (String token :appContext.configuration().startTokens()){
|
||||
try {
|
||||
String context = authorizationService().get(token).getContext();
|
||||
if(instanciatedManagerPerScope.get(context) != null ) {
|
||||
for (ManagerPair manager: instanciatedManagerPerScope.get(context)){
|
||||
try{
|
||||
log.info("stoppping {} in context {} ",appContext.name(), context);
|
||||
=======
|
||||
for (String context :appContext.authorizationProvider().getContexts())
|
||||
this.onRemove(context);
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
|
||||
<<<<<<< HEAD
|
||||
SecurityTokenProvider.instance.set(token);
|
||||
ScopeProvider.instance.set(context);
|
||||
try {
|
||||
manager.getFuture().get().onShutdown();
|
||||
log.info("manager {} correctly suhtdown on context {}",appContext.name(), context);
|
||||
} catch (Exception e){
|
||||
log.warn("problem calling onShutdown for context {}", context, e);
|
||||
}
|
||||
}catch(Exception e){
|
||||
log.error("error retrieving token on shutdown on context {}", context,e);
|
||||
throw new RuntimeException("error retrieving token on shutdown",e);
|
||||
}finally{
|
||||
ScopeProvider.instance.reset();
|
||||
SecurityTokenProvider.instance.reset();
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (ObjectNotFound e1) {
|
||||
log.error("token not found : {}",token,e1);
|
||||
} catch (Exception e1) {
|
||||
log.error("something failed getting token {}",token,e1);
|
||||
}
|
||||
}
|
||||
=======
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
unregister();
|
||||
}
|
||||
|
||||
|
@ -229,14 +167,8 @@ public class OnlineObserver implements AppManagerObserver{
|
|||
}
|
||||
|
||||
@Override
|
||||
<<<<<<< HEAD
|
||||
public void setStartingTokens(Collection<String> startingTokens) {
|
||||
this.startingTokens = startingTokens;
|
||||
=======
|
||||
public void setAuthorizationProvider(AuthorizationProvider authProvider) {
|
||||
this.authProvider = authProvider;
|
||||
>>>>>>> refs/remotes/origin/feature/22955
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue