use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class SCServiceProfileViewBean method handleTblSubConfigButtonDeleteRequest.
/**
* Deletes sub configuration.
*
* @param event Request Invocation Event.
* @throws ModelControlException if table model cannot be restored.
*/
public void handleTblSubConfigButtonDeleteRequest(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
CCActionTable tbl = (CCActionTable) getChild(AMPropertySheetModel.TBL_SUB_CONFIG);
tbl.restoreStateData();
CCActionTableModel tblModel = (CCActionTableModel) tbl.getModel();
Integer[] selected = tblModel.getSelectedRows();
SerializedField szCache = (SerializedField) getChild(SZ_CACHE);
List list = (List) szCache.getSerializedObj();
Set names = new HashSet(selected.length * 2);
for (int i = 0; i < selected.length; i++) {
SMSubConfig sc = (SMSubConfig) list.get(selected[i].intValue());
names.add(sc.getName());
}
try {
SubSchemaModel model = (SubSchemaModel) getModel();
model.deleteSubConfigurations(names);
if (selected.length == 1) {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted");
} else {
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "subconfig.message.deleted.pural");
}
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
submitCycle = false;
forwardTo();
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class SCSOAPBindingRequestHandlerListEditViewBean method handleButton1Request.
protected void handleButton1Request(Map values) throws AMConsoleException {
SCSOAPBindingViewBean vb = (SCSOAPBindingViewBean) getViewBean(SCSOAPBindingViewBean.class);
Map mapAttrs = (Map) getPageSessionAttribute(SCSOAPBindingViewBean.PROPERTY_ATTRIBUTE);
OrderedSet serverList = (OrderedSet) mapAttrs.get(SCSOAPBindingModelImpl.ATTRIBUTE_NAME_REQUEST_HANDLER_LIST);
int index = Integer.parseInt((String) getPageSessionAttribute(PGATTR_INDEX));
String val = SOAPBindingRequestHandler.toString((String) values.get(ATTR_KEY), (String) values.get(ATTR_CLASS), (String) values.get(ATTR_ACTION));
int count = 0;
for (Iterator i = serverList.iterator(); i.hasNext(); ) {
String v = (String) i.next();
if ((count != index) && v.equals(val)) {
throw new AMConsoleException("soapBinding.service.requestHandlerList.already.exist");
}
count++;
}
serverList.set(index, val);
setPageSessionAttribute(SCSOAPBindingViewBean.PAGE_MODIFIED, "1");
backTrail();
unlockPageTrailForSwapping();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class SCSAML2SOAPBindingViewBean method handleTblRequestHandlerListHrefEditActionRequest.
/**
* Handles edit request handler request.
*
* @param event Request Invocation Event.
*/
public void handleTblRequestHandlerListHrefEditActionRequest(RequestInvocationEvent event) throws ModelControlException {
try {
Map values = getValues();
onBeforeSaveProfile(values);
setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) values);
SCSAML2SOAPBindingRequestHandlerListEditViewBean vb = (SCSAML2SOAPBindingRequestHandlerListEditViewBean) getViewBean(SCSAML2SOAPBindingRequestHandlerListEditViewBean.class);
unlockPageTrail();
passPgSessionMap(vb);
vb.populateValues((String) getDisplayFieldValue(TBL_REQUEST_HANDLER_LIST_HREF_EDIT_ACTION));
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class SCSOAPBindingViewBean method handleTblRequestHandlerListButtonAddRequest.
/**
* Handles add request handler request.
*
* @param event Request Invocation Event.
*/
public void handleTblRequestHandlerListButtonAddRequest(RequestInvocationEvent event) throws ModelControlException {
try {
Map values = getValues();
onBeforeSaveProfile(values);
setPageSessionAttribute(PROPERTY_ATTRIBUTE, (HashMap) values);
SCSOAPBindingRequestHandlerListAddViewBean vb = (SCSOAPBindingRequestHandlerListAddViewBean) getViewBean(SCSOAPBindingRequestHandlerListAddViewBean.class);
unlockPageTrail();
passPgSessionMap(vb);
vb.forwardTo(getRequestContext());
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class TaskModelImpl method getEntities.
private Set getEntities(String realm, String cotName, boolean bIDP, boolean hosted) throws AMConsoleException {
try {
SAML2MetaManager mgr = new SAML2MetaManager();
Set entities = getEntities(realm, cotName);
Set results = new HashSet();
for (Iterator i = entities.iterator(); i.hasNext(); ) {
String entityId = (String) i.next();
EntityConfigElement elm = mgr.getEntityConfig(realm, entityId);
// elm could be null due to OPENAM-269
if (elm != null && elm.isHosted() == hosted) {
EntityDescriptorElement desc = mgr.getEntityDescriptor(realm, entityId);
if (bIDP) {
if (SAML2MetaUtils.getIDPSSODescriptor(desc) != null) {
results.add(entityId);
}
} else {
if (SAML2MetaUtils.getSPSSODescriptor(desc) != null) {
results.add(entityId);
}
}
}
}
return results;
} catch (SAML2MetaException ex) {
throw new AMConsoleException(ex.getMessage());
}
}
Aggregations