/**
* 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: NotCondition.java,v 1.1 2009/08/19 05:40:33 veiming Exp $
*
* Portions copyright 2014-2015 ForgeRock AS.
*/
/**
* This class wrapped on an Entitlement Condition object to provide boolean
* NOT.
* Membership of <code>NotCondition</code> is satisfied in the user is not a
* member of the nested <code>EntitlementCondition</code>.
*
* We @JsonIgnore getEConditions and setEConditions (NOTE the 's' on the end) so that
* we don't indicate via JSON schema exposed that we take multiple condition types.
*
* We extend LogicalCondition but ensure that we are only allowing a single
* {@link EntitlementCondition} to be referenced by this class.
*/
/**
* Constructs <code>NotCondition</code>
*/
public NotCondition() {
}
/**
* Constructs NotCondition
*
* @param eCondition wrapped <code>EntitlementCondition</code>(s)
*/
this.eCondition = eCondition;
}
/**
* Constructs <code>NotCondition</code>.
*
* @param eConditions wrapped <code>EntitlementCondition</code>(s)
* @param pConditionName subject name as used in OpenAM policy,
* this is relevant only when UserECondition was created from
* OpenAM policy Condition
*/
public NotCondition(
) {
this.eCondition = eConditions;
this.pConditionName = pConditionName;
}
/**
* Sets state of the object
*
* @param state State of the object encoded as string
*/
try {
if (memberCondition != null) {
}
} catch (InstantiationException ex) {
} catch (IllegalAccessException ex) {
} catch (ClassNotFoundException ex) {
} catch (JSONException ex) {
}
}
/**
* Returns state of the object.
*
* @return state of the object encoded as string.
*/
return toString();
}
/**
* Returns <code>ConditionDecision</code> of
* <code>EntitlementCondition</code> evaluation
*
* @param realm Realm name.
* @param subject EntitlementCondition who is under evaluation.
* @param resourceName Resource name.
* @param environment Environment parameters.
* @return <code>ConditionDecision</code> of
* <code>EntitlementCondition</code> evaluation
* @throws EntitlementException if error occurs.
*/
) throws EntitlementException {
if (eCondition == null) {
}
return ConditionDecision
.build();
}
/**
* Sets the nested <code>EntitlementCondition</code>(s).
*
* @param eCondition the nested <code>EntitlementCondition</code>(s)
*/
this.eCondition = eCondition;
}
/**
* Returns the nested <code>EntitlementCondition</code>(s).
*
* @return the nested <code>EntitlementCondition</code>(s).
*/
return eCondition;
}
/**
* Sets the nested <code>EntitlementCondition</code>(s).
*
* @param eConditions the nested <code>EntitlementCondition</code>(s)
*/
}
/**
* Returns the nested <code>EntitlementCondition</code>(s).
*
* @return the nested <code>EntitlementCondition</code>(s).
*/
if (eCondition == null) {
return null;
}
}
/**
* Sets OpenAM policy Condition name
* @param pConditionName subject name as used in OpenAM policy,
* this is relevant only when UserECondition was created from
* OpenAM policy Condition
*/
this.pConditionName = pConditionName;
}
/**
* Returns OpenAM policy Condition name
* @return subject name as used in OpenAM policy,
* this is relevant only when UserECondition was created from
* OpenAM policy Condition
*/
return pConditionName;
}
/**
* Returns JSONObject mapping of the object
* @return JSONObject mapping of the object
* @throws org.json.JSONException if can not map to JSONObject
*/
if (eCondition != null) {
}
return jo;
}
/**
* Returns string representation of the object
* @return string representation of the object
*/
try {
} catch (JSONException e) {
}
return s;
}
/**
* Returns <code>true</code> if the passed in object is equal to this object
* @param obj object to check for equality
* @return <code>true</code> if the passed in object is equal to this object
*/
return false;
}
return false;
}
if (eCondition == null) {
return false;
}
} else {
return false;
}
}
if (pConditionName == null) {
return false;
}
} else {
return false;
}
}
return true;
}
/**
* Returns hash code of the object
* @return hash code of the object
*/
public int hashCode() {
if (eCondition != null) {
}
if (pConditionName != null) {
}
return code;
}
if (eCondition == null) {
}
}
}