use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class AbstractAuditModel method getEventHandlerDefaultValues.
/**
* Get the default attribute values for the specified event handler type (schema ID).
*
* @param eventHandlerType The name of the event handler type.
* @return A map of default event handler attribute values.
* @throws AMConsoleException If an error occurs whilst reading the attributes.
*/
public Map<String, Set<?>> getEventHandlerDefaultValues(String eventHandlerType) throws AMConsoleException {
try {
Map<String, Set<?>> defaultValues = new HashMap<>();
ServiceSchema handlerSchema = getServiceSchema().getSubSchema(eventHandlerType);
Set attributeSchemas = handlerSchema.getAttributeSchemas();
for (Object value : attributeSchemas) {
AttributeSchema as = (AttributeSchema) value;
Set values = as.getDefaultValues();
if (values != null) {
defaultValues.put(as.getName(), values);
}
}
return defaultValues;
} catch (SSOException | SMSException e) {
throw new AMConsoleException(getErrorString(e));
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class AbstractAuditModel method getPropertySheetXML.
@Override
public String getPropertySheetXML(String realmName, String viewBeanName, String viewBeanClassName) throws AMConsoleException {
DelegationConfig dc = DelegationConfig.getInstance();
boolean readOnly = !dc.hasPermission(realmName, serviceName, PERMISSION_MODIFY, this, viewBeanClassName);
xmlBuilder.setAllAttributeReadOnly(readOnly);
xmlBuilder.setSupportSubConfig(true);
xmlBuilder.setViewBeanName(viewBeanName);
try {
return xmlBuilder.getXML();
} catch (SSOException | SMSException e) {
throw new AMConsoleException(getErrorString(e));
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class CoreAttributesViewBean method handleButton1Request.
/**
* Handles cancel request.
*
* @param event Request invocation event.
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
try {
CoreAttributesModel model = (CoreAttributesModel) getModel();
Map original = model.getAttributeValues();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
model.setAttributeValues(ps.getAttributeValues(original, true, model));
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "message.updated");
forwardTo();
} catch (AMConsoleException a) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", a.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class AuthConfigViewBean method cacheValues.
private void cacheValues() throws ModelControlException {
AuthConfigurationModel acModel = (AuthConfigurationModel) getModel();
try {
Map original = acModel.getValues();
AMPropertySheet ps = (AMPropertySheet) getChild(PROPERTY_ATTRIBUTE);
Map changedValues = (Map) ps.getAttributeValues(original, true, acModel);
original.putAll(changedValues);
setPageSessionAttribute(ReorderAuthChainsViewBean.PG_SESSION_TRACKING, (HashMap) changedValues);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
forwardTo();
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class SAMLv2AuthnAuthorityViewBean method getStandardAuthnAuthorityValues.
private Map getStandardAuthnAuthorityValues() {
Map map = new HashMap();
try {
SAMLv2Model model = (SAMLv2Model) getModel();
map = model.getStandardAuthnAuthorityAttributes(realm, entityName);
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
return map;
}
Aggregations