use of org.wso2.carbon.identity.user.profile.mgt.listener.ProfileMgtEventListener in project carbon-identity-framework by wso2.
the class IdentityUserProfileServiceComponent method activate.
@Activate
protected void activate(ComponentContext ctxt) {
try {
if (log.isDebugEnabled()) {
log.debug("User Profile Mgt bundle is activated ");
}
ServiceRegistration userStoreConfigEventSR = ctxt.getBundleContext().registerService(UserStoreConfigListener.class.getName(), new UserStoreConfigListenerImpl(), null);
if (userStoreConfigEventSR != null) {
if (log.isDebugEnabled()) {
log.debug("User profile management - UserStoreConfigListener registered.");
}
} else {
log.error("User profile management - UserStoreConfigListener could not be registered.");
}
ServiceRegistration profileMgtEventSR = ctxt.getBundleContext().registerService(UserOperationEventListener.class.getName(), new ProfileMgtEventListener(), null);
// Check whether the IDN tables exist at the beginning.
ServiceHodler.setIsIDNTableExist(isIDNTablesExist());
if (log.isDebugEnabled()) {
log.debug("Is IDN_ASSOCIATED_ID table exist: " + ServiceHodler.isIDNTableExist());
}
if (profileMgtEventSR != null) {
if (log.isDebugEnabled()) {
log.debug("User profile management - ProfileMgtEventListener registered.");
}
} else {
log.error("User profile management - ProfileMgtEventListener could not be registered.");
}
FederatedAssociationManager federatedAssociationManager = new FederatedAssociationManagerImpl();
ServiceRegistration federatedAssociationManagerSR = ctxt.getBundleContext().registerService(FederatedAssociationManager.class.getName(), federatedAssociationManager, null);
if (federatedAssociationManagerSR != null) {
if (log.isDebugEnabled()) {
log.debug("User profile management - FederatedAssociationManager registered.");
}
IdentityUserProfileServiceDataHolder.getInstance().setFederatedAssociationManager(federatedAssociationManager);
} else {
log.error("User profile management - FederatedAssociationManager could not be registered.");
}
} catch (Throwable e) {
log.error("Failed to activate ProfileMgt bundle ", e);
}
}
Aggregations