use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class ResponseProviderAddViewBean method handleButton2Request.
/**
* Handles create policy request.
*
* @param event Request invocation event
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
boolean forwarded = false;
submitCycle = true;
try {
ResponseProvider provider = createResponseProvider();
if (provider != null) {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
String name = (String) propertySheetModel.getValue(RESPONSEPROVIDER_NAME);
policy.addResponseProvider(name, provider);
backTrail();
forwardToPolicyViewBean();
forwarded = true;
}
} catch (NameAlreadyExistsException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getModel().getErrorString(e));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
if (!forwarded) {
forwardTo();
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class ReferralEditViewBean method getDefaultValues.
protected Set getDefaultValues() {
Set values = null;
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
String referralName = (String) getPageSessionAttribute(PG_SESSION_REFERRAL_NAME);
Referral referral = policy.getReferral(referralName);
values = referral.getValues();
} catch (NameNotFoundException e) {
debug.warning("ReferralEditViewBean.getDefaultValues", e);
} catch (AMConsoleException e) {
debug.warning("ReferralEditViewBean.getDefaultValues", e);
}
return values;
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class ReferralAddViewBean method handleButton2Request.
/**
* Handles create policy request.
*
* @param event Request invocation event
*/
public void handleButton2Request(RequestInvocationEvent event) throws ModelControlException {
boolean forwarded = false;
submitCycle = true;
try {
Referral referral = createReferral();
if (referral != null) {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
String name = (String) propertySheetModel.getValue(REFERRAL_NAME);
policy.addReferral(name, referral);
backTrail();
forwardToPolicyViewBean();
forwarded = true;
}
} catch (NameAlreadyExistsException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getModel().getErrorString(e));
} catch (InvalidNameException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", getModel().getErrorString(e));
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
} finally {
if (!forwarded) {
forwardTo();
}
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class RuleOpViewBeanBase method isReferralPolicy.
protected boolean isReferralPolicy() {
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
return policy.isReferralPolicy();
} catch (AMConsoleException e) {
debug.warning("RuleOpViewBeanBase.isReferralPolicy", e);
return false;
}
}
use of com.sun.identity.console.base.model.AMConsoleException in project OpenAM by OpenRock.
the class ServerEditGeneralViewBean method handleButton1Request.
/**
* Handles create site request.
*
* @param event Request invocation event
*/
public void handleButton1Request(RequestInvocationEvent event) throws ModelControlException {
submitCycle = true;
String serverName = (String) getPageSessionAttribute(PG_ATTR_SERVER_NAME);
String parentSite = (serverName.equals(ServerConfiguration.DEFAULT_SERVER_CONFIG)) ? null : (String) getDisplayFieldValue(PARENT_SITE);
ServerSiteModel model = (ServerSiteModel) getModel();
try {
model.modifyServer(serverName, parentSite, getAttributeValues());
setInlineAlertMessage(CCAlert.TYPE_INFO, "message.information", "serverconfig.updated");
} catch (UnknownPropertyNameException e) {
// ignore. this cannot happen because property in this page
// is customized.
} catch (AMConsoleException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", e.getMessage());
}
forwardTo();
}
Aggregations