use of com.sun.identity.console.policy.model.CachedPolicy in project OpenAM by OpenRock.
the class ProfileViewBeanBase method getCachedPolicy.
protected CachedPolicy getCachedPolicy() throws AMConsoleException {
CachedPolicy policy = null;
String cacheID = (String) getPageSessionAttribute(PG_SESSION_POLICY_CACHE_ID);
if (cacheID != null) {
PolicyCache cache = PolicyCache.getInstance();
PolicyModel model = (PolicyModel) getModel();
policy = model.getCachedPolicy(cacheID);
}
return policy;
}
use of com.sun.identity.console.policy.model.CachedPolicy 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.policy.model.CachedPolicy 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.policy.model.CachedPolicy in project OpenAM by OpenRock.
the class RuleEditViewBean method getRule.
protected Rule getRule() throws NameNotFoundException, AMConsoleException {
CachedPolicy cachedPolicy = getCachedPolicy();
Policy policy = cachedPolicy.getPolicy();
String ruleName = (String) getPageSessionAttribute(EDIT_RULE_NAME);
return policy.getRule(ruleName);
}
use of com.sun.identity.console.policy.model.CachedPolicy in project OpenAM by OpenRock.
the class RuleOpViewBeanBase method getCachedPolicy.
protected CachedPolicy getCachedPolicy() throws AMConsoleException {
CachedPolicy policy = null;
String cacheID = (String) getPageSessionAttribute(ProfileViewBeanBase.PG_SESSION_POLICY_CACHE_ID);
if (cacheID != null) {
PolicyCache cache = PolicyCache.getInstance();
PolicyModel model = (PolicyModel) getModel();
policy = model.getCachedPolicy(cacheID);
}
return policy;
}
Aggregations