use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMCommonNameGenerator method initialize.
private void initialize() {
try {
serviceSchemaManager = new ServiceSchemaManager(G11N_SERVICE_NAME, adminSSOToken);
serviceConfigManager = new ServiceConfigManager(G11N_SERVICE_NAME, adminSSOToken);
//listener for org
serviceConfigManager.addListener(this);
//listener for global
serviceSchemaManager.addListener(this);
} catch (SMSException smse) {
debug.error("AMCommonNameGenerator.initManager", smse);
} catch (SSOException ssoe) {
debug.error("AMCommonNameGenerator.initManager", ssoe);
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMModelBase method isAMSDKEnabled.
/**
* Returns <code>true</code> if server is running with <code>AMSDK</code>
* repo enabled.
*
* @return <code>true</code> if server is running with <code>AMSDK</code>
* repo enabled.
*/
public boolean isAMSDKEnabled() {
try {
ServiceSchemaManager schemaMgr = new ServiceSchemaManager(IdConstants.REPO_SERVICE, AMAdminUtils.getSuperAdminSSOToken());
ServiceSchema orgSchema = schemaMgr.getOrganizationSchema();
Set names = orgSchema.getSubSchemaNames();
return (names != null) && names.contains("amSDK");
} catch (SMSException e) {
debug.error("AMModelBase.isAMSDKEnabled", e);
return false;
} catch (SSOException e) {
debug.error("AMModelBase.isAMSDKEnabled", e);
return false;
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMAdminUtils method getSchemaSchema.
/**
* Returns service schema for an IdType.
*
* @param serviceName Name of Service.
* @param idType IdType.
* @return service schema for an IdType.
*/
public static ServiceSchema getSchemaSchema(String serviceName, IdType idType) {
ServiceSchema serviceSchema = null;
SSOToken adminSSOToken = (SSOToken) AccessController.doPrivileged(AdminTokenAction.getInstance());
try {
ServiceSchemaManager mgr = new ServiceSchemaManager(serviceName, adminSSOToken);
serviceSchema = mgr.getSchema(idType.getName());
} catch (SSOException e) {
debug.warning("AMAdminUtils.getAttributeSchemas", e);
} catch (SMSException e) {
debug.warning("AMAdminUtils.getAttributeSchemas", e);
}
return serviceSchema;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMModelBase method getServiceSchemaManager.
/**
* Gets service schema manager, we cache instance of this manager per
* HTTP request
*
* @param name of service
* @return service schema manager
* @throws SSOException when SSO token is invalid
* @throws SMSException when we are unable to retrieve the service
* schema manager
*/
protected ServiceSchemaManager getServiceSchemaManager(String name) throws SSOException, SMSException {
ServiceSchemaManager mgr = (ServiceSchemaManager) mapSvcSchemaMgrs.get(name);
if (mgr == null) {
mgr = new ServiceSchemaManager(name, getUserSSOToken());
mapSvcSchemaMgrs.put(name, mgr);
}
return mgr;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class AMModelBase method getServiceResourceBundle.
protected ResourceBundle getServiceResourceBundle(String serviceName) {
ResourceBundle rb = null;
try {
ServiceSchemaManager mgr = new ServiceSchemaManager(serviceName, ssoToken);
String rbName = mgr.getI18NFileName();
if ((rbName != null) && (rbName.trim().length() > 0)) {
rb = AMResBundleCacher.getBundle(rbName, locale);
}
} catch (SSOException e) {
debug.warning("AMModelBase.getServiceResourceBundle", e);
} catch (SMSException e) {
debug.warning("AMModelBase.getServiceResourceBundle", e);
}
return rb;
}
Aggregations