Search in sources :

Example 1 with SecretDAO

use of org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO in project carbon-identity-framework by wso2.

the class SecretManagerComponent method activate.

/**
 * Register SecretManager as an OSGI service.
 *
 * @param componentContext OSGI service component context.
 */
@Activate
protected void activate(ComponentContext componentContext) {
    BundleContext bundleContext = componentContext.getBundleContext();
    SecretDAO secretDAO = new SecretDAOImpl();
    bundleContext.registerService(SecretDAO.class.getName(), new CachedBackedSecretDAO(secretDAO), null);
    bundleContext.registerService(SecretManager.class.getName(), new SecretManagerImpl(), null);
    bundleContext.registerService(SecretResolveManager.class.getName(), new SecretResolveManagerImpl(), null);
    SecretManagerComponentDataHolder.getInstance().setSecretManagementEnabled(isSecretManagementEnabled());
}
Also used : SecretManagerImpl(org.wso2.carbon.identity.secret.mgt.core.SecretManagerImpl) CachedBackedSecretDAO(org.wso2.carbon.identity.secret.mgt.core.dao.impl.CachedBackedSecretDAO) SecretResolveManagerImpl(org.wso2.carbon.identity.secret.mgt.core.SecretResolveManagerImpl) SecretResolveManager(org.wso2.carbon.identity.secret.mgt.core.SecretResolveManager) SecretManager(org.wso2.carbon.identity.secret.mgt.core.SecretManager) BundleContext(org.osgi.framework.BundleContext) SecretDAO(org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO) CachedBackedSecretDAO(org.wso2.carbon.identity.secret.mgt.core.dao.impl.CachedBackedSecretDAO) SecretDAOImpl(org.wso2.carbon.identity.secret.mgt.core.dao.impl.SecretDAOImpl) Activate(org.osgi.service.component.annotations.Activate)

Example 2 with SecretDAO

use of org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO in project carbon-identity-framework by wso2.

the class SecretManagerTest method prepareConfigs.

private void prepareConfigs() {
    SecretDAO secretDAO = new SecretDAOImpl();
    SecretManagerComponentDataHolder.getInstance().setSecretDAOS(Collections.singletonList(secretDAO));
    mockCarbonContextForTenant(SUPER_TENANT_ID, SUPER_TENANT_DOMAIN_NAME);
    mockIdentityTenantUtility();
    secretManager = new SecretManagerImpl();
    secretResolveManager = new SecretResolveManagerImpl();
}
Also used : SecretDAO(org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO) SecretDAOImpl(org.wso2.carbon.identity.secret.mgt.core.dao.impl.SecretDAOImpl)

Aggregations

SecretDAO (org.wso2.carbon.identity.secret.mgt.core.dao.SecretDAO)2 SecretDAOImpl (org.wso2.carbon.identity.secret.mgt.core.dao.impl.SecretDAOImpl)2 BundleContext (org.osgi.framework.BundleContext)1 Activate (org.osgi.service.component.annotations.Activate)1 SecretManager (org.wso2.carbon.identity.secret.mgt.core.SecretManager)1 SecretManagerImpl (org.wso2.carbon.identity.secret.mgt.core.SecretManagerImpl)1 SecretResolveManager (org.wso2.carbon.identity.secret.mgt.core.SecretResolveManager)1 SecretResolveManagerImpl (org.wso2.carbon.identity.secret.mgt.core.SecretResolveManagerImpl)1 CachedBackedSecretDAO (org.wso2.carbon.identity.secret.mgt.core.dao.impl.CachedBackedSecretDAO)1