use of com.sun.identity.policy.ConditionTypeManager in project OpenAM by OpenRock.
the class PolicyModelImpl method getConditionViewBeanURL.
/**
* Returns properties view bean URL of a condition.
*
* @param realmName Name of realm.
* @param condition Condition Object.
* @return properties view bean URL of a condition.
*/
public String getConditionViewBeanURL(String realmName, Condition condition) {
String url = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ConditionTypeManager conditionTypeMgr = policyMgr.getConditionTypeManager();
url = conditionTypeMgr.getViewBeanURL(condition);
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
}
return url;
}
use of com.sun.identity.policy.ConditionTypeManager in project OpenAM by OpenRock.
the class PolicyModelImpl method getConditionViewBeanURL.
/**
* Returns properties view bean URL of a condition.
*
* @param realmName Name of realm.
* @param conditionTypeName Name of Condition Type.
* @return properties view bean URL of a condition.
*/
public String getConditionViewBeanURL(String realmName, String conditionTypeName) {
String url = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ConditionTypeManager condTypeMgr = policyMgr.getConditionTypeManager();
Condition condition = condTypeMgr.getCondition(conditionTypeName);
url = condTypeMgr.getViewBeanURL(condition);
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
} catch (NameNotFoundException e) {
debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
} catch (PolicyException e) {
debug.warning("PolicyModelImpl.getConditionViewBeanURL", e);
}
return url;
}
use of com.sun.identity.policy.ConditionTypeManager in project OpenAM by OpenRock.
the class PrivilegePolicyMapping method createIPCondition.
private Condition createIPCondition(PolicyManager pm) throws PolicyException {
ConditionTypeManager mgr = pm.getConditionTypeManager();
Condition cond = mgr.getCondition("IPCondition");
cond.setProperties(ipConditionEnvMap);
return cond;
}
use of com.sun.identity.policy.ConditionTypeManager in project OpenAM by OpenRock.
the class PrivilegePolicyMapping method createIPCondition1.
private Condition createIPCondition1(PolicyManager pm) throws PolicyException {
ConditionTypeManager mgr = pm.getConditionTypeManager();
Condition cond = mgr.getCondition("IPCondition");
cond.setProperties(ipConditionEnvMap1);
return cond;
}
use of com.sun.identity.policy.ConditionTypeManager in project OpenAM by OpenRock.
the class PolicyModelImpl method getActiveConditionTypes.
/**
* Returns a map of active condition types for a realm to its display name.
*
* @param realmName Name of Realm.
* @return a map of active condition types for a realm to its display name.
*/
public Map getActiveConditionTypes(String realmName) {
Map condTypes = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ConditionTypeManager condTypeMgr = policyMgr.getConditionTypeManager();
if (condTypeMgr != null) {
Set types = condTypeMgr.getSelectedConditionTypeNames();
condTypes = new HashMap(types.size() * 2);
for (Iterator iter = types.iterator(); iter.hasNext(); ) {
String rName = (String) iter.next();
condTypes.put(rName, condTypeMgr.getDisplayName(rName));
}
}
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getActiveConditionTypes", e);
} catch (SSOException e) {
debug.warning("PolicyModelImpl.getActiveConditionTypes", e);
} catch (NameNotFoundException e) {
debug.warning("PolicyModelImpl.getActiveConditionTypes", e);
} catch (PolicyException e) {
debug.warning("PolicyModelImpl.getActiveConditionTypes", e);
}
return (condTypes == null) ? Collections.EMPTY_MAP : condTypes;
}
Aggregations