use of org.wso2.carbon.identity.configuration.mgt.core.ConfigurationManagerImpl in project carbon-identity-framework by wso2.
the class ConfigurationManagerComponent method activate.
/**
* Register ConfigurationManager as an OSGI service.
*
* @param componentContext OSGI service component context.
*/
@Activate
protected void activate(ComponentContext componentContext) {
try {
BundleContext bundleContext = componentContext.getBundleContext();
ConfigurationDAO configurationDAO = new ConfigurationDAOImpl();
bundleContext.registerService(ConfigurationDAO.class.getName(), configurationDAO, null);
bundleContext.registerService(ConfigurationDAO.class.getName(), new CachedBackedConfigurationDAO(configurationDAO), null);
ConfigurationManagerConfigurationHolder configurationManagerConfigurationHolder = new ConfigurationManagerConfigurationHolder();
configurationManagerConfigurationHolder.setConfigurationDAOS(configurationDAOs);
bundleContext.registerService(ConfigurationManager.class.getName(), new ConfigurationManagerImpl(configurationManagerConfigurationHolder), null);
ConfigurationManagerComponentDataHolder.getInstance().setConfigurationManagementEnabled(isConfigurationManagementEnabled());
setUseCreatedTime();
} catch (Throwable e) {
log.error("Error while activating ConfigurationManagerComponent.", e);
}
}
use of org.wso2.carbon.identity.configuration.mgt.core.ConfigurationManagerImpl in project carbon-identity-framework by wso2.
the class ConfigurationManagementUtils method getConfigurationManager.
public static ConfigurationManager getConfigurationManager() {
ConfigurationManagerComponentDataHolder.setUseCreatedTime(true);
ConfigurationManagerConfigurationHolder configurationHolder = new ConfigurationManagerConfigurationHolder();
ConfigurationDAO configurationDAO = new ConfigurationDAOImpl();
configurationHolder.setConfigurationDAOS(Collections.singletonList(configurationDAO));
ConfigurationManager configurationManager = new ConfigurationManagerImpl(configurationHolder);
ConfigurationManagerComponentDataHolder.getInstance().setConfigurationManagementEnabled(true);
return configurationManager;
}
use of org.wso2.carbon.identity.configuration.mgt.core.ConfigurationManagerImpl in project carbon-identity-framework by wso2.
the class ConfigurationManagerTest method prepareConfigs.
private void prepareConfigs() throws Exception {
// Mock get maximum query length call.
mockStatic(IdentityUtil.class);
when(IdentityUtil.getProperty(any(String.class))).thenReturn("4194304");
when(IdentityUtil.getEndpointURIPath(any(String.class), anyBoolean(), anyBoolean())).thenReturn("/t/bob.com/api/identity/config-mgt/v1.0/resource/file/publisher/SMSPublisher/9e038218-8e99-4dae-bf83-a78f5dcd73a8");
ConfigurationManagerComponentDataHolder.setUseCreatedTime(true);
ConfigurationManagerConfigurationHolder configurationHolder = new ConfigurationManagerConfigurationHolder();
ConfigurationDAO configurationDAO = new ConfigurationDAOImpl();
configurationHolder.setConfigurationDAOS(Collections.singletonList(configurationDAO));
mockCarbonContextForTenant(SUPER_TENANT_ID, SUPER_TENANT_DOMAIN_NAME);
mockIdentityTenantUtility();
configurationManager = new ConfigurationManagerImpl(configurationHolder);
}
Aggregations