69 lines
1.8 KiB
Java
69 lines
1.8 KiB
Java
package org.gcube.idm;
|
|
|
|
import org.gcube.common.security.providers.SecretManagerProvider;
|
|
import org.gcube.smartgears.ApplicationManager;
|
|
import org.slf4j.Logger;
|
|
import org.slf4j.LoggerFactory;
|
|
|
|
/**
|
|
* @author Alfredo Oliviero (ISTI - CNR)
|
|
*/
|
|
public class IdentityManagerdInitializator implements ApplicationManager {
|
|
|
|
/**
|
|
* Logger
|
|
*/
|
|
private static Logger logger = LoggerFactory.getLogger(IdentityManagerdInitializator.class);
|
|
|
|
public static boolean initialised;
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
@Override
|
|
public synchronized void onInit() {
|
|
|
|
String context = SecretManagerProvider.instance.get().getContext();
|
|
|
|
logger.trace(
|
|
"\n-------------------------------------------------------\n"
|
|
+ "Identity Manager Service is Starting on context {}\n"
|
|
+ "-------------------------------------------------------",
|
|
context);
|
|
|
|
// ApplicationContext applicationContext = ContextProvider.get();
|
|
// String helloWorldEServiceID = applicationContext.id();
|
|
|
|
logger.trace(
|
|
"\n-------------------------------------------------------\n"
|
|
+ "Identity Manager Service Started Successfully on context {}\n"
|
|
+ "-------------------------------------------------------",
|
|
context);
|
|
|
|
|
|
|
|
}
|
|
|
|
/**
|
|
* {@inheritDoc}
|
|
*/
|
|
@Override
|
|
public synchronized void onShutdown(){
|
|
|
|
String context = SecretManagerProvider.instance.get().getContext();
|
|
|
|
logger.trace(
|
|
"\n-------------------------------------------------------\n"
|
|
+ "Identity Manager Service is Stopping on context {}\n"
|
|
+ "-------------------------------------------------------",
|
|
context);
|
|
|
|
|
|
logger.trace(
|
|
"\n-------------------------------------------------------\n"
|
|
+ "Identity Manager Service Stopped Successfully on context {}\n"
|
|
+ "-------------------------------------------------------",
|
|
context);
|
|
}
|
|
}
|