use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AuthUtils method getGlobalAttributes.
/**
* Returns <code>Map</code> attributes
*
* @param serviceName Service Name
* @return <code>Map</code> of global attributes.
*/
public static Map getGlobalAttributes(String serviceName) {
Map attrs = null;
try {
SSOToken dUserToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
ServiceSchemaManager scm = new ServiceSchemaManager(serviceName, dUserToken);
ServiceSchema schema = scm.getGlobalSchema();
if (schema != null) {
attrs = schema.getAttributeDefaults();
}
} catch (SMSException smsExp) {
utilDebug.error("AuthUtils.getGlobalAttributes: SMS Error", smsExp);
} catch (SSOException ssoExp) {
utilDebug.error("AuthUtils.getGlobalAttributes: SSO Error", ssoExp);
}
if (utilDebug.messageEnabled()) {
utilDebug.message("AuthUtils.getGlobalAttributes: attrs=" + attrs);
}
return attrs;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class ComplianceServicesImpl method isComplianceUserDeletionEnabled.
/**
* Method which checks if Compliance User Deletion is enabled
*
* @return true if Compliance User Deletion is enabled
* @exception AMException
* if an error is encountered
*/
public static boolean isComplianceUserDeletionEnabled() throws AMException {
try {
if (gsc == null) {
ServiceSchemaManager scm = new ServiceSchemaManager(ADMINISTRATION_SERVICE, internalToken);
gsc = scm.getGlobalSchema();
}
Map attrMap = gsc.getReadOnlyAttributeDefaults();
Set values = (Set) attrMap.get(COMPLIANCE_USER_DELETION_ATTR);
boolean enabled = false;
if (values == null || values.isEmpty()) {
enabled = false;
} else {
String val = (String) values.iterator().next();
enabled = (val.equalsIgnoreCase("true"));
}
if (debug.messageEnabled()) {
debug.message("Compliance.isComplianceUserDeletionEnabled = " + enabled);
}
return enabled;
} catch (SMSException ex) {
debug.error(AMSDKBundle.getString("359"), ex);
throw new AMException(AMSDKBundle.getString("359"), "359");
} catch (SSOException ex) {
debug.error(AMSDKBundle.getString("359"), ex);
throw new AMException(AMSDKBundle.getString("359"), "359");
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class EventService method isAMSDKConfigured.
private static boolean isAMSDKConfigured() {
boolean isAMSDKConfigured = false;
boolean configTime = isDuringConfigurationTime();
logger.message("EventService.getListenerList(): {}: {}", Constants.SYS_PROPERTY_INSTALL_TIME, configTime);
if (!configTime) {
try {
ServiceSchemaManager scm = new ServiceSchemaManager(AccessController.doPrivileged(AdminTokenAction.getInstance()), IdConstants.REPO_SERVICE, "1.0");
ServiceSchema idRepoSubSchema = scm.getOrganizationSchema();
Set idRepoPlugins = idRepoSubSchema.getSubSchemaNames();
if (idRepoPlugins.contains("amSDK")) {
isAMSDKConfigured = true;
}
} catch (SMSException ex) {
logger.warning("EventService.getListenerList() - Unable to obtain idrepo service", ex);
} catch (SSOException ex) {
// Should not happen, ignore the exception
}
}
return isAMSDKConfigured;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AuthD method initPlatformServiceGlobalSettings.
/**
* Initialized platform service global attributes
* @throws SMSException if it fails to initialize platform service
* @throws SSOException if admin <code>SSOToken</code> is not valid
*/
private void initPlatformServiceGlobalSettings() throws SMSException, SSOException {
ServiceSchemaManager scm = new ServiceSchemaManager(ISAuthConstants.PLATFORM_SERVICE_NAME, ssoAuthSession);
updatePlatformServiceGlobals(scm);
new AuthConfigMonitor(scm);
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AuthD method initAuthConfigGlobalSettings.
/**
* Initialize the AuthConfiguration global attributes.
* @throws SMSException if it fails to get auth service for name
* @throws SSOException if admin <code>SSOToken</code> is not valid
* @throws Exception
*/
private void initAuthConfigGlobalSettings() throws Exception {
ServiceSchemaManager scm = new ServiceSchemaManager(ISAuthConstants.AUTHCONFIG_SERVICE_NAME, ssoAuthSession);
updateAuthConfigGlobals(scm);
new AuthConfigMonitor(scm);
}
Aggregations