PolicyCondition.java revision 78d425f83177385e7e1dc33cca56dcd6b1f116bf
/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2009 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: PolicyCondition.java,v 1.2 2010/01/08 22:12:49 farble1670 Exp $
*/
/*
* Portions Copyrighted 2010-2014 ForgeRock AS
*/
/**
* This condition wraps all OpenSSO policy condition.
*/
public class PolicyCondition extends EntitlementConditionAdaptor {
public PolicyCondition() {
}
/**
* Constructor.
*
* @param name Name of condition.
* @param className Implementation class name.
* @param properties Properties of the condition.
*/
public PolicyCondition(
this.properties = properties;
}
/**
* Returns class name.
*
* @return class name.
*/
public String getClassName() {
return className;
}
/**
* Returns name.
*
* @return name.
*/
return name;
}
/**
* Returns properties.
*
* @return properties.
*/
return properties;
}
/**
* Sets the state of this condition.
*
* @param state State of this condition.
*/
try {
} catch (JSONException e) {
}
}
throws JSONException {
}
}
return result;
}
/**
* Returns state of this condition.
*
* @return state of this condition.
*/
try {
} catch (JSONException ex) {
}
return "";
}
/**
* Returns condition decision.
*
* @param realm Realm name.
* @param subject Subject to be evaluated.
* @param resourceName Resource name.
* @param environment Environment map.
* @return condition decision.
* @throws com.sun.identity.entitlement.EntitlementException if error occur.
*/
public ConditionDecision evaluate(
) throws EntitlementException {
try {
} catch (SSOException ex) {
} catch (PolicyException ex) {
}
}
if (o instanceof SSOToken) {
return (SSOToken)o;
}
}
return null;
}
return false;
}
return false;
}
return false;
}
return false;
}
}
public String getDisplayType() {
return "policy";
}
/**
* Constructs a legacy policy {@link Condition} object based on the information contained in this adapter.
*
* @return the legacy policy condition.
* @throws EntitlementException if an error occurs constructing the condition.
*/
try {
return cond;
} catch (ClassNotFoundException cnfe) {
} catch (ClassCastException cce) {
throw new EntitlementException(POLICY_CLASS_CAST_EXCEPTION, new String[]{className, Condition.class.getName()}, cce);
} catch (InstantiationException ie) {
} catch (IllegalAccessException iae) {
} catch (PolicyException pe) {
}
}
public void validate() throws EntitlementException {
// Attempt to load the policy condition to validate it
}
}