use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class SMDiscoveryServiceModelImpl method addMoreAttributeSchemasForModification.
protected void addMoreAttributeSchemasForModification(Set attributeSchemas) {
super.addMoreAttributeSchemasForModification(attributeSchemas);
ServiceSchemaManager mgr = getServiceSchemaManager();
try {
ServiceSchema global = mgr.getSchema(SchemaType.GLOBAL);
attributeSchemas.add(global.getAttributeSchema(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF));
} catch (SMSException e) {
debug.error("SMDiscoveryServiceModelImpl.addMoreAttributeSchemasForModification", e);
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class SMDiscoveryServiceModelImpl method getDiscoEntry.
/**
* Returns resource offering entry stored in the model map for a given
* type.
*
* @param dynamic value to indicate if it is a dynamic or not.
* @return resource offering entry stored in the model map for a given
* type.
*/
public Set getDiscoEntry(boolean dynamic) {
Set set = null;
if (dynamic) {
// TO FIX
} else {
ServiceSchemaManager mgr = getServiceSchemaManager();
try {
ServiceSchema schema = mgr.getSchema(SchemaType.GLOBAL);
AttributeSchema as = schema.getAttributeSchema(AMAdminConstants.DISCOVERY_SERVICE_NAME_BOOTSTRAP_RES_OFF);
set = as.getDefaultValues();
} catch (SMSException e) {
debug.error("SMDiscoveryServiceModelImpl.getDiscoEntry", e);
}
}
return set;
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class MAPModelBase method getServiceResourceBundle.
private void getServiceResourceBundle() {
try {
ServiceSchemaManager scm = new ServiceSchemaManager(mapServiceName, getUserSSOToken());
String name = scm.getI18NFileName();
if ((name != null) && (name.length() > 0)) {
serviceResourceBundle = AMResBundleCacher.getBundle(name, getUserLocale());
}
} catch (SMSException e) {
debug.warning("MAPModelBase.getServiceResourceBundle", e);
} catch (SSOException e) {
debug.warning("MAPModelBase.getServiceResourceBundle", e);
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class SCModelBase method initializeSchemaManager.
/*
* Establishes the ServiceSchemaManager connection for future operations.
*/
private void initializeSchemaManager() {
String error = null;
try {
manager = new ServiceSchemaManager(getServiceName(), getUserSSOToken());
} catch (SSOException e) {
error = e.getMessage();
} catch (SMSException e) {
error = e.getMessage();
}
if (error != null && debug.warningEnabled()) {
debug.warning("couldn't initialize schema manager for " + getServiceName());
debug.warning("reason: " + error);
}
}
use of com.sun.identity.sm.ServiceSchemaManager in project OpenAM by OpenRock.
the class SCUtils method getLocalizedServiceName.
public static String getLocalizedServiceName(String serviceName, Locale locale) throws SMSException, SSOException, MissingResourceException {
String localizedName = null;
ServiceSchemaManager mgr = new ServiceSchemaManager(serviceName, adminSSOToken);
ResourceBundle rb = ResourceBundle.getBundle(mgr.getI18NFileName(), locale);
Set types = mgr.getSchemaTypes();
if (!types.isEmpty()) {
SchemaType type = (SchemaType) types.iterator().next();
ServiceSchema schema = mgr.getSchema(type);
if (schema != null) {
String i18nKey = schema.getI18NKey();
if ((i18nKey != null) && (i18nKey.trim().length() > 0)) {
localizedName = rb.getString(i18nKey);
}
}
}
return localizedName;
}
Aggregations