PolicySubject.java revision 0fb4093da08d574d3d1b661d4425dfbac8e02aab
/**
* 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: PolicySubject.java,v 1.1 2009/08/19 05:40:36 veiming Exp $
*
* Portions Copyrighted 2014-2015 ForgeRock AS.
*/
/**
* This subject wraps all OpenAM policy subjects.
*/
public class PolicySubject implements EntitlementSubject {
private boolean exclusive;
public PolicySubject() {
}
/**
* Constructor.
*
* @param name Name of condition.
* @param className Implementation class name.
* @param values Values of this subject.
* @param exclusive <code>true</code> to be exclusive.
*/
public PolicySubject(
boolean exclusive
) {
}
/**
* Returns name.
* @return name.
*/
return name;
}
/**
* Returns class name.
*
* @return class name.
*/
public String getClassName() {
return className;
}
/**
* Returns values.
*
* @return values.
*/
return values;
}
/**
* Returns <code>true</code> if this is an exclusive subject.
*
* @return <code>true</code> if this is an exclusive subject.
*/
public boolean isExclusive() {
return exclusive;
}
/**
* Sets states
*
* @param state State.
*/
try {
} catch (JSONException ex) {
}
}
throws JSONException {
}
return result;
}
/**
* Returns state of this subject.
*
* @return state of this subject.
*/
try {
} catch (JSONException ex) {
}
return "";
}
/**
* Returns search index attributes.
*
* @return search index attributes.
*/
return map;
}
/**
* Returns required attribute names.
*
* @return required attribute names.
*/
return(Collections.EMPTY_SET);
}
/**
* Returns subject decision.
*
* @param realm Realm name.
* @param mgr Subject attribute manager
* @param subject Subject to be evaluated.
* @param resourceName Resource name to be evaluated.
* @param environment Environment map.
* @return subject decision.
* @throws com.sun.identity.entitlement.EntitlementException if error
* occurs.
*/
public SubjectDecision evaluate(
) throws EntitlementException {
try {
} catch (SSOException ex) {
} catch (PolicyException ex) {
}
}
// subject could be null, a case in point: evaluation ignoring subjects
return null;
}
if (o instanceof SSOToken) {
return (SSOToken)o;
}
}
return null;
}
/**
* Returns <code>true</code> is this subject is an identity object.
*
* @return <code>true</code> is this subject is an identity object.
*/
public boolean isIdentity() {
return true;
}
/**
* Constructs a legacy policy subject based on the information in this adapter.
*
* @return the legacy policy subject
* @throws EntitlementException if an error occurs constructing the subject.
*/
try {
return subject;
}
}
}