Search in sources :

Example 1 with ClaimMetadataStoreFactory

use of org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataStoreFactory in project carbon-identity-framework by wso2.

the class IdentityClaimManagementServiceComponent method activate.

@Activate
protected void activate(ComponentContext ctxt) {
    try {
        BundleContext bundleCtx = ctxt.getBundleContext();
        IdentityClaimManagementServiceDataHolder.getInstance().setBundleContext(bundleCtx);
        if (IdentityClaimManagementServiceDataHolder.getInstance().getClaimConfigInitDAO() == null) {
            IdentityClaimManagementServiceDataHolder.getInstance().setClaimConfigInitDAO(new DefaultClaimConfigInitDAO());
        }
        ClaimMetadataStoreFactory claimMetadataStoreFactory = new ClaimMetadataStoreFactory();
        bundleCtx.registerService(ClaimManagerFactory.class.getName(), claimMetadataStoreFactory, null);
        ClaimMetadataManagementService claimManagementService = new ClaimMetadataManagementServiceImpl();
        bundleCtx.registerService(ClaimMetadataManagementService.class.getName(), claimManagementService, null);
        IdentityClaimManagementServiceDataHolder.getInstance().setClaimManagementService(claimManagementService);
        bundleCtx.registerService(TenantMgtListener.class.getName(), new ClaimMetadataTenantMgtListener(), null);
        registerClaimConfigListener(bundleCtx);
        // Register claim operation event handler implementation.
        bundleCtx.registerService(AbstractEventHandler.class.getName(), new ClaimMetadataManagementAuditLogger(), null);
        if (log.isDebugEnabled()) {
            log.debug("ClaimMetadataManagementAuditLogger is successfully registered.");
            log.debug("Identity Claim Management Core bundle is activated");
        }
    } catch (Throwable e) {
        log.error("Error occurred while activating Identity Claim Management Service Component", e);
    }
}
Also used : ClaimMetadataTenantMgtListener(org.wso2.carbon.identity.claim.metadata.mgt.listener.ClaimMetadataTenantMgtListener) TenantMgtListener(org.wso2.carbon.stratos.common.listeners.TenantMgtListener) ClaimMetadataManagementAuditLogger(org.wso2.carbon.identity.claim.metadata.mgt.listener.ClaimMetadataManagementAuditLogger) ClaimMetadataStoreFactory(org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataStoreFactory) AbstractEventHandler(org.wso2.carbon.identity.event.handler.AbstractEventHandler) ClaimManagerFactory(org.wso2.carbon.user.core.claim.ClaimManagerFactory) ClaimMetadataTenantMgtListener(org.wso2.carbon.identity.claim.metadata.mgt.listener.ClaimMetadataTenantMgtListener) ClaimMetadataManagementServiceImpl(org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementServiceImpl) ClaimMetadataManagementService(org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementService) DefaultClaimConfigInitDAO(org.wso2.carbon.identity.claim.metadata.mgt.internal.impl.DefaultClaimConfigInitDAO) BundleContext(org.osgi.framework.BundleContext) Activate(org.osgi.service.component.annotations.Activate)

Aggregations

BundleContext (org.osgi.framework.BundleContext)1 Activate (org.osgi.service.component.annotations.Activate)1 ClaimMetadataManagementService (org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementService)1 ClaimMetadataManagementServiceImpl (org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataManagementServiceImpl)1 ClaimMetadataStoreFactory (org.wso2.carbon.identity.claim.metadata.mgt.ClaimMetadataStoreFactory)1 DefaultClaimConfigInitDAO (org.wso2.carbon.identity.claim.metadata.mgt.internal.impl.DefaultClaimConfigInitDAO)1 ClaimMetadataManagementAuditLogger (org.wso2.carbon.identity.claim.metadata.mgt.listener.ClaimMetadataManagementAuditLogger)1 ClaimMetadataTenantMgtListener (org.wso2.carbon.identity.claim.metadata.mgt.listener.ClaimMetadataTenantMgtListener)1 AbstractEventHandler (org.wso2.carbon.identity.event.handler.AbstractEventHandler)1 TenantMgtListener (org.wso2.carbon.stratos.common.listeners.TenantMgtListener)1 ClaimManagerFactory (org.wso2.carbon.user.core.claim.ClaimManagerFactory)1