use of com.sun.identity.sm.ServiceConfigManager in project OpenAM by OpenRock.
the class OpenAMSettingsImpl method getServiceConfig.
private ServiceConfig getServiceConfig(String realm) throws SMSException, SSOException {
final SSOToken token = AccessController.doPrivileged(AdminTokenAction.getInstance());
final ServiceConfigManager serviceConfigManager = new ServiceConfigManager(token, serviceName, serviceVersion);
return serviceConfigManager.getOrganizationConfig(realm, null);
}
use of com.sun.identity.sm.ServiceConfigManager in project OpenAM by OpenRock.
the class SMSConfigProvider method registerListener.
void registerListener(String source, ServiceListener listener) {
ServiceConfigManager configManager = getConfigManager(source);
configManager.addListener(listener);
}
use of com.sun.identity.sm.ServiceConfigManager in project OpenAM by OpenRock.
the class SMSConfigProvider method getConfigManager.
private ServiceConfigManager getConfigManager(String source) {
try {
ServiceConfigManager configManager = configManageCache.get(source);
if (configManager == null) {
synchronized (configManageCache) {
configManager = configManageCache.get(source);
if (configManager == null) {
configManager = new ServiceConfigManager(ssoTokenPrivilegedAction.run(), source, SERVICE_VERSION);
configManageCache.put(source, configManager);
}
}
}
return configManager;
} catch (SMSException | SSOException e) {
throw new ConfigRetrievalException("Unable to retrieve config manager " + source, e);
}
}
use of com.sun.identity.sm.ServiceConfigManager in project OpenAM by OpenRock.
the class RadiusServerGuiceModule method getRadiusServiceConfigManger.
/**
* Guice provider for the ServiceConfigManager.
*
* @return a ServiceConfigurationManager that can be used
* @throws RadiusLifecycleException - when the service config manager can not be obtained.
*/
@Provides
@Named("RadiusServer")
protected ServiceConfigManager getRadiusServiceConfigManger() throws RadiusLifecycleException {
ServiceConfigManager mgr = null;
// get a ServiceConfigManager for our service
try {
final SSOToken admTk = AccessController.doPrivileged(AdminTokenAction.getInstance());
mgr = new ServiceConfigManager(RadiusServerConstants.RADIUS_SERVICE_NAME, admTk);
} catch (final Exception e) {
throw new RadiusLifecycleException("Could not obtain ServiceConfigManger for the RADIUS service.", e);
}
return mgr;
}
use of com.sun.identity.sm.ServiceConfigManager in project OpenAM by OpenRock.
the class SFOConfigValidator method processSFO.
private void processSFO(SSOToken ssoToken) {
boolean isSessionFailoverEnabled = false;
String sessionStoreUserName = null;
String sessionStorePassword = null;
HashMap clusterMemberMap = new HashMap();
// in milli-second
int connectionMaxWaitTime = 5000;
String jdbcDriverClass = null;
String sessionRepositoryURL = null;
int minPoolSize = 8;
int maxPoolSize = 32;
// in milli-second
int maxWaitTimeForConstraint = 6000;
boolean isPropertyNotificationEnabled = false;
Set notificationProperties;
toolOutWriter.printMessage("sfo-validate-cfg-prop");
try {
ServiceConfigManager scm = new ServiceConfigManager(amSessionService, ssoToken);
ServiceConfig serviceConfig = scm.getGlobalConfig(null);
String subCfgName = SiteConfiguration.getSiteIdByURL(ssoToken, getSessionServerURL());
ServiceConfig subConfig = serviceConfig.getSubConfig(subCfgName);
String[] params = { getSessionServerURL() };
if (subConfig != null) {
Map sessionAttrs = subConfig.getAttributes();
boolean sfoEnabled = Boolean.valueOf(CollectionHelper.getMapAttr(sessionAttrs, CoreTokenConstants.IS_SFO_ENABLED, "false")).booleanValue();
if (sfoEnabled) {
isSessionFailoverEnabled = true;
toolOutWriter.printMessage("sfo-cfg-enabled", params);
sessionStoreUserName = CollectionHelper.getMapAttr(sessionAttrs, SESSION_STORE_USERNAME, "amsvrusr");
sessionStorePassword = CollectionHelper.getMapAttr(sessionAttrs, SESSION_STORE_PASSWORD, "password");
connectionMaxWaitTime = Integer.parseInt(CollectionHelper.getMapAttr(sessionAttrs, CONNECT_MAX_WAIT_TIME, "5000"));
jdbcDriverClass = CollectionHelper.getMapAttr(sessionAttrs, JDBC_DRIVER_CLASS, "");
sessionRepositoryURL = CollectionHelper.getMapAttr(sessionAttrs, IPLANET_AM_SESSION_REPOSITORY_URL, "");
validateClusterList(sessionRepositoryURL);
minPoolSize = Integer.parseInt(CollectionHelper.getMapAttr(sessionAttrs, MIN_POOL_SIZE, "8"));
maxPoolSize = Integer.parseInt(CollectionHelper.getMapAttr(sessionAttrs, MAX_POOL_SIZE, "32"));
toolOutWriter.printMessage("sfo-cfg-prop-details");
String[] params1 = { sessionStoreUserName, sessionRepositoryURL, Integer.toString(connectionMaxWaitTime), Integer.toString(minPoolSize), Integer.toString(maxPoolSize) };
toolOutWriter.printMessage("sfo-cfg-params", params1);
} else {
toolOutWriter.printMessage("sfo-cfg-not-enabled", params);
}
} else {
toolOutWriter.printMessage("sfo-cfg-not-enabled", params);
}
} catch (Exception ex) {
toolOutWriter.printError("sfo-cfg-prop-notfound");
toolOutWriter.printStatusMsg(false, "sfo-validate-cfg-prop");
Debug.getInstance(DEBUG_NAME).error("SFOConfigValidator.processSFO: " + "Exception in validating sfo configuration " + "information", ex);
}
}
Aggregations