use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMDCTree method dcNodeAttributes.
private static Set dcNodeAttributes() throws AMException {
try {
if (gsc == null) {
ServiceSchemaManager scm = new ServiceSchemaManager(ADMINISTRATION_SERVICE, (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance()));
gsc = scm.getGlobalSchema();
}
Map attrMap = gsc.getAttributeDefaults();
Set values = (Set) attrMap.get(DCT_ATTRIBUTE_LIST_ATTR);
if (values == null) {
if (debug.messageEnabled()) {
debug.message("DCTree.dcNodeAttributes = null");
}
return Collections.EMPTY_SET;
} else {
if (debug.messageEnabled()) {
debug.message("DCTree.dcNodeAttributes = " + values.toString());
}
return values;
}
} catch (SMSException ex) {
debug.error(AMSDKBundle.getString("908"), ex);
throw new AMException(AMSDKBundle.getString("908"), "908");
} catch (SSOException ex) {
debug.error(AMSDKBundle.getString("902"), ex);
throw new AMException(AMSDKBundle.getString("902"), "902");
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMCompliance method isAdminGroupsEnabled.
/**
* Method which checks if Admin Groups need to be created for an
* organization.
* @param orgDN organization dn
* @return true if Admin Groups need to be created
* @exception AMException if an error is encountered
*/
protected static boolean isAdminGroupsEnabled(String orgDN) throws AMException {
if (!isUnderRootSuffix(orgDN)) {
return false;
}
try {
if (AMDCTree.gsc == null) {
ServiceSchemaManager scm = new ServiceSchemaManager(ADMINISTRATION_SERVICE, (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance()));
AMDCTree.gsc = scm.getGlobalSchema();
}
Map attrMap = AMDCTree.gsc.getReadOnlyAttributeDefaults();
Set values = (Set) attrMap.get(ADMIN_GROUPS_ENABLED_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.isAdminGroupsEnabled = " + enabled);
}
return enabled;
} catch (SMSException ex) {
debug.error(AMSDKBundle.getString("357"), ex);
throw new AMException(AMSDKBundle.getString("357"), "357");
} catch (SSOException ex) {
debug.error(AMSDKBundle.getString("357"), ex);
throw new AMException(AMSDKBundle.getString("357"), "357");
}
//return compl.isAdminGroupsEnabled(orgDN);
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class EntryEventListener method getDynamicAttributeNames.
private Set getDynamicAttributeNames(String serviceName) {
Set attrNames = Collections.EMPTY_SET;
try {
ServiceSchemaManager sm = new ServiceSchemaManager(serviceName, internalToken);
ServiceSchema sschema = sm.getSchema(SchemaType.DYNAMIC);
attrNames = sschema.getAttributeSchemaNames();
} catch (SMSException smse) {
if (debug.warningEnabled()) {
debug.warning("EntryEventListener.entryChanged(): " + "caught SMSException: ", smse);
}
} catch (SSOException ssoe) {
if (debug.warningEnabled()) {
debug.error("EntryEventListener.entryChanged(): " + "caught SSOException: ", ssoe);
}
}
return attrNames;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class SchemaCommand method getServiceSchemaManager.
protected ServiceSchemaManager getServiceSchemaManager(String serviceName) throws CLIException {
ServiceSchemaManager mgr = null;
SSOToken adminSSOToken = getAdminSSOToken();
if (serviceName != null) {
try {
mgr = new ServiceSchemaManager(serviceName, adminSSOToken);
} catch (SSOException e) {
debugError("SchemaCommand.getServiceSchemaManager", e);
throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
} catch (SMSException e) {
debugError("SchemaCommand.getServiceSchemaManager", e);
throw new CLIException(e, ExitCodes.REQUEST_CANNOT_BE_PROCESSED);
}
}
return mgr;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class SmsRequestHandler method addServersRoutes.
private void addServersRoutes(ServiceManager sm, Map<String, Map<SmsRouteTree, Set<RouteMatcher<Request>>>> serviceRoutes) throws SSOException, SMSException {
ServiceSchemaManager ssm = sm.getSchemaManager(ISAuthConstants.PLATFORM_SERVICE_NAME, DEFAULT_VERSION);
Set<RouteMatcher<Request>> rootRoutes = new HashSet<>();
serviceRoutes.get(ISAuthConstants.PLATFORM_SERVICE_NAME).put(routeTree, rootRoutes);
addServersRoutes(ssm, rootRoutes, ConfigurationBase.CONFIG_SERVERS, ConfigurationBase.SUBSCHEMA_SERVER);
}
Aggregations