Search in sources :

Example 1 with ProfileMgtEventListener

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);
    }
}
Also used : FederatedAssociationManager(org.wso2.carbon.identity.user.profile.mgt.association.federation.FederatedAssociationManager) UserOperationEventListener(org.wso2.carbon.user.core.listener.UserOperationEventListener) ProfileMgtEventListener(org.wso2.carbon.identity.user.profile.mgt.listener.ProfileMgtEventListener) FederatedAssociationManagerImpl(org.wso2.carbon.identity.user.profile.mgt.association.federation.FederatedAssociationManagerImpl) UserStoreConfigListener(org.wso2.carbon.identity.user.store.configuration.listener.UserStoreConfigListener) ServiceRegistration(org.osgi.framework.ServiceRegistration) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

ServiceRegistration (org.osgi.framework.ServiceRegistration)1 Activate (org.osgi.service.component.annotations.Activate)1 FederatedAssociationManager (org.wso2.carbon.identity.user.profile.mgt.association.federation.FederatedAssociationManager)1 FederatedAssociationManagerImpl (org.wso2.carbon.identity.user.profile.mgt.association.federation.FederatedAssociationManagerImpl)1 ProfileMgtEventListener (org.wso2.carbon.identity.user.profile.mgt.listener.ProfileMgtEventListener)1 UserStoreConfigListener (org.wso2.carbon.identity.user.store.configuration.listener.UserStoreConfigListener)1 UserOperationEventListener (org.wso2.carbon.user.core.listener.UserOperationEventListener)1