use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AuthUtils method getAuthRevisionNumber.
public static int getAuthRevisionNumber() {
try {
SSOToken token = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
ServiceSchemaManager scm = new ServiceSchemaManager(ISAuthConstants.AUTH_SERVICE_NAME, token);
return scm.getRevisionNumber();
} catch (Exception e) {
if (utilDebug.messageEnabled()) {
utilDebug.message("getAuthRevisionNumber error", e);
}
}
return 0;
}
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 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);
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class NamingService method initialize.
public static void initialize() {
namingDebug = Debug.getInstance("amNaming");
platformProperties = SystemProperties.getAll();
server_proto = platformProperties.getProperty("com.iplanet.am.server.protocol", "");
server_host = platformProperties.getProperty("com.iplanet.am.server.host", "");
server_port = platformProperties.getProperty(Constants.AM_SERVER_PORT, "");
PrivilegedAction<SSOToken> adminAction = InjectorHolder.getInstance(Key.get(new TypeLiteral<PrivilegedAction<SSOToken>>() {
}));
sso = AccessController.doPrivileged(adminAction);
try {
ssmNaming = new ServiceSchemaManager(NAMING_SERVICE, sso);
ssmPlatform = new ServiceSchemaManager(PLATFORM_SERVICE, sso);
serviceRevNumber = ssmPlatform.getRevisionNumber();
} catch (SMSException | SSOException e) {
throw new IllegalStateException(e);
}
ServiceListeners.Action action = new ServiceListeners.Action() {
@Override
public void performUpdate() {
try {
updateNamingTable();
WebtopNaming.updateNamingTable();
} catch (Exception ex) {
namingDebug.error("Error occured in updating naming table", ex);
}
}
};
ServiceListeners builder = InjectorHolder.getInstance(ServiceListeners.class);
builder.config(NAMING_SERVICE).global(action).schema(action).listen();
builder.config(PLATFORM_SERVICE).global(action).schema(action).listen();
}
Aggregations