use of com.sun.identity.policy.ConditionTypeManager 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.ConditionTypeManager in project OpenAM by OpenRock.
the class PolicyModelImpl method getConditionTypeName.
/**
* Returns condition type name of a condition.
*
* @param realmName Name of realm.
* @param condition Condition instance.
* @return Condition type name of a condition.
*/
public String getConditionTypeName(String realmName, Condition condition) {
String typeName = null;
try {
PolicyManager policyMgr = getPolicyManager(realmName);
if (policyMgr != null) {
ConditionTypeManager conditionTypeMgr = policyMgr.getConditionTypeManager();
typeName = conditionTypeMgr.getConditionTypeName(condition);
}
} catch (AMConsoleException e) {
debug.warning("PolicyModelImpl.getConditionTypeName", e);
}
return typeName;
}
use of com.sun.identity.policy.ConditionTypeManager 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;
}
Aggregations