use of com.sun.identity.policy.NameNotFoundException in project OpenAM by OpenRock.
the class PolicyModelImpl method getSubjectViewBeanURL.
/**
* Returns properties view bean URL of a subject.
*
* @param realmName Name of realm.
* @param subjectTypeName Name of Subject Type.
* @return properties view bean URL of a subject.
*/
public String getSubjectViewBeanURL(String realmName, String subjectTypeName) {
String url = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
SubjectTypeManager subjectTypeMgr = policyMgr.getSubjectTypeManager();
Subject subject = subjectTypeMgr.getSubject(subjectTypeName);
url = subjectTypeMgr.getViewBeanURL(subject);
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getSubjectViewBeanURL", e);
} catch (NameNotFoundException e) {
debug.warning("PolicyModelImpl.getSubjectViewBeanURL", e);
} catch (PolicyException e) {
debug.warning("PolicyModelImpl.getSubjectViewBeanURL", e);
}
return url;
}
use of com.sun.identity.policy.NameNotFoundException in project OpenAM by OpenRock.
the class PolicyModelImpl method getConditionInstance.
private Condition getConditionInstance(String realmName, String conditionTypeName) {
Condition condition = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ConditionTypeManager condTypeMgr = policyMgr.getConditionTypeManager();
condition = condTypeMgr.getCondition(conditionTypeName);
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getConditionInstance", e);
} catch (NameNotFoundException e) {
debug.warning("PolicyModelImpl.getConditionInstance", e);
} catch (PolicyException e) {
debug.warning("PolicyModelImpl.getConditionInstance", e);
}
return condition;
}
use of com.sun.identity.policy.NameNotFoundException in project OpenAM by OpenRock.
the class PolicyModelImpl method getReferralViewBeanURL.
/**
* Returns properties view bean URL of a referral.
*
* @param realmName Name of realm.
* @param referralTypeName Name of Referral Type.
* @return properties view bean URL of a referral.
*/
public String getReferralViewBeanURL(String realmName, String referralTypeName) {
String url = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ReferralTypeManager referralTypeMgr = policyMgr.getReferralTypeManager();
Referral referral = referralTypeMgr.getReferral(referralTypeName);
url = referralTypeMgr.getViewBeanURL(referral);
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getReferralViewBeanURL", e);
} catch (NameNotFoundException e) {
debug.warning("PolicyModelImpl.getReferralViewBeanURL", e);
} catch (PolicyException e) {
debug.warning("PolicyModelImpl.getReferralViewBeanURL", e);
}
return url;
}
use of com.sun.identity.policy.NameNotFoundException in project OpenAM by OpenRock.
the class PolicyModelImpl method createCondition.
/**
* Returns a condition object.
*
* @param realmName Name of Realm.
* @param conditionType Name of condition type.
* @param values Values of the condition.
* @return condition object.
* @throws AMConsoleException if condition cannot be created.
*/
public Condition createCondition(String realmName, String conditionType, Map values) throws AMConsoleException {
Condition condition = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ConditionTypeManager conditionTypeMgr = policyMgr.getConditionTypeManager();
condition = conditionTypeMgr.getCondition(conditionType);
condition.setProperties(values);
}
} catch (NameNotFoundException e) {
throw new AMConsoleException(getErrorString(e));
} catch (PolicyException e) {
throw new AMConsoleException(getErrorString(e));
}
return condition;
}
use of com.sun.identity.policy.NameNotFoundException in project OpenAM by OpenRock.
the class PolicyOpViewBeanBase method handleTblResponseProvidersEditLinkRequest.
public void handleTblResponseProvidersEditLinkRequest(RequestInvocationEvent event) throws ModelControlException {
PolicyModel model = (PolicyModel) getModel();
String name = hexToString((String) getDisplayFieldValue(TBL_RESPONSE_ATTRIBUTES_ACTION_HREF));
setPageSessionAttribute(ResponseProviderEditViewBean.CALLING_VIEW_BEAN, getClass().getName());
setPageSessionAttribute(ResponseProviderEditViewBean.EDIT_RESPONSEPROVIDER_NAME, name);
try {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
ResponseProvider provider = policy.getResponseProvider(name);
String realmName = (String) getPageSessionAttribute(AMAdminConstants.CURRENT_REALM);
String responseProviderType = model.getResponseProviderTypeName(realmName, provider);
String viewBeanURL = model.getResponseProviderViewBeanURL(realmName, responseProviderType);
unlockPageTrail();
if ((viewBeanURL != null) && (viewBeanURL.trim().length() > 0)) {
forwardToResponseProviderURL(viewBeanURL, name, responseProviderType, realmName, "edit");
} else {
forwardToResponseProviderEditViewBean(model, realmName, name, responseProviderType);
}
} catch (NameNotFoundException e) {
setInlineAlertMessage(CCAlert.TYPE_ERROR, "message.error", model.getErrorString(e));
forwardTo();
} catch (AMConsoleException e) {
debug.warning("PolicyOpViewBeanBase.handleTblResponseProvidersEditLinkRequest", e);
redirectToStartURL();
}
}
Aggregations